0% found this document useful (0 votes)
5 views2 pages

Unit 3 - Dbms - Cs Worksheet 2-Answer

The document is a worksheet on Database Management Systems (DBMS) and SQL, containing true/false questions, multiple-choice questions, and SQL command exercises. It covers topics such as data types, table constraints, integrity constraints, and commands for creating and modifying databases and tables. Additionally, it includes assertions and reasoning related to SQL concepts, along with specific SQL queries for practical application.

Uploaded by

vishuddha2769u
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views2 pages

Unit 3 - Dbms - Cs Worksheet 2-Answer

The document is a worksheet on Database Management Systems (DBMS) and SQL, containing true/false questions, multiple-choice questions, and SQL command exercises. It covers topics such as data types, table constraints, integrity constraints, and commands for creating and modifying databases and tables. Additionally, it includes assertions and reasoning related to SQL concepts, along with specific SQL queries for practical application.

Uploaded by

vishuddha2769u
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

COMPUTER SCIENCE WORKSHEET

TOPIC: DBMS & SQL

1. Say True/False. In SQL, the values for date data type can be stored in the form ‘DD-MM-YYYY’.-
FALSE
2. Which of the following SQL command allows us to perform tasks related to database schema?
a) DDL b) DML c) TCL d) None of these.
3. Identify the following which is a text that is not executed in MySQL.
a) Statement b) Query c) Comment d) Clause.
4. Which of the following type of table constraints will prevent the entry of duplicate rows?
a) Unique b) Distinct c) Primary Key d) NULL
5. Which of the following special character cannot be used to name a table?
a) $ b) @ c) - d)All of these
6. Write a query to create and open a database DB and Create a table EMPLOYEE with fields
EMP_NO – string , EMP_DESGN – string , EMP_SAL – decimal , DOJ – date.
Answer: create database db;
Use db;
Create table employee(emp_no varchar(20),
emp_design varchar(20),
emp_sal decimal(4,2),
DOJ date);
7. In RDBMS, R stands for
a) Relational b)Rotational c)Rational d)None of the above
8. Cardinality is total .
a) number of rows in a table b) number of columns in a table
c) number of data items in a table d) none of the above
6. Degree refers to total
a) number of rows in a table b) number of columns in a table
c) number of data items in a table d) none of the above
7. Referential Integrity is a rule that ensures between records in related tables are valid.
a) Links b)difference c)relationship d)similarity
8. Data about data is .
a) Data redundancy b) Meta Data c) Database schema d) None of the above
9. Repetition of data is called .
a) Data redundancy b) Data Description c) Data inconsistency d) None of the above
10. Mismatched redundant copies of data is known as data .
a) Dependence b)Inconsistency c)Isolation d)Redundancy
18. A is a property of the entire relation, rather than of the individual tuples in which each
tuple is unique.
a) Rows b)Key c)Attribute d)Fields
19. A integrity constraint requires that the values appearing in specified attributes of any tuple in
the referencing relation also appear in specified attributes of at least one tuple in the referenced relation.
a) Referencing b) Referential c) Primary d) Specific

Choose the correct choice as:


(a) Both Assertion (A) and Reason (R) are the true and (R) is a correct explanation of (A).
(b) Both Assertion (A) and Reason (R) are the true but (R) is not a correct explanation of (A).
(c) Assertion (A) is true and Reason (R) is false. (d) Assertion (A) is false and Reason (R) is true.

20. Assertion (A): Primary key constraints allows NULL values.


Reason (R): The primary key constraints ensures that a column can contain unique Values for each row.
Answer: A is False and R is True.

21. Assertion (A): UNIQUE keyword ensures no duplicate values in a table.


Reason (R): DISTINCT is similar to UNIQUE

Answer: A is True and R is False


22. A table TEACHER has attributes CODE, NAME, POST, CATEGORY. Write down the command to
delete the attribute CATEGORY from this table.
ALTER TABLE teacher DROP category;

23. Write the queries to Create a database named as ‘Company’ and then Create a Table with use of
NOT NULL and Primary Key constraints for following relation definition:
Staff (StaffID, FirstName, LastName, IsQualified) where

Answer: CREATE DATABASE company;


Use company;
CREATE TABLE staff(staffId char(5) PRIMARY KEY,
FirstName varchar(20) NOT NULL,
LastName varchar(15),
IsQualified char(4));

24. An organisation named PRIDE wants to put all the data in the form of records. The records are
stored in a table and tables are stored in a database. Which DDL command is used to create a
database name PRIDE.

PNO-Candidate Key
Degree-4(No of columns)
Cardinality-5(No of rows)
25. James wants to see the whole structure of a relation titled as “MotorCycle” which have already
been developed in MySQL in the database named as “TwoWheeler”. What query he should write
when he just opened MySQL on his machine?
USE Twowheeler; DESC Motorcycle;

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy