79 solutions available
Question 1Assertion. The PRIMARY KEY and UNIQUE constraints are the same.Reason. The columns with PRIMARY KEY or UNIQUE constraints have unique...
Question 2Assertion. The treatment of NULL values is different with PRIMARY KEY and UNIQUE constraints.Reason. The column(s) with PRIMARY KEY do not...
Question 3Assertion. There is no restriction on the number of columns that can have PRIMARY KEY constraint or UNIQUE constraints.Reason. There can be...
Question 4Assertion. There are different commands for creating and changing table design.Reason. The CREATE TABLE command creates the tables while...
Question 5Assertion. Both DELETE and DROP TABLE carry out the same thing — deletion in tables.Reason. The DELETE command deletes the rows and DROP...
Question 6Assertion. Both UPDATE and ALTER TABLE commands are similar.Reason. The UPDATE command as well ALTER TABLE command make changes in the...
Question 1Which command is used for creating tables ?
Question 2What is a constraint ? Name some constraints that you can apply to enhance database integrity.
Question 3What is the role of UNIQUE constraint ? How is PRIMARY KEY constraint different from UNIQUE constraint ?
Question 4What is primary key ? What is PRIMARY KEY constraint ?
Question 5What is NOT NULL constraint ? What is DEFAULT constraint ?
Question 6When a column's value is skipped in an INSERT command, which value is inserted in the database ?
Question 7Can a column defined with NOT NULL constraint, be skipped in an INSERT command ?
Question 8How would you view the structure of table Dept ?
Question 9Table Empl has same structure as that of table EMPL. Write a query statement to insert data from table NewEmpl into EMPL where salary and...
Question 10What is the error in following statement ?UPDATE EMPL ;
Question 11Identify the error :DELETE ALL FROM TABLE EMPL ;
Question 12Differentiate between DDL and DML.
Question 1A database can be opened with USE <database> command.
Question 2To list the names of existing database, you can use SHOW DATABASES command.
Question 3A constraint is a condition or check applicable on a field or a set of fields.
Question 4The REFERENCES constraint creates a foreign key.
Question 5Issue COMMIT command to make changes to a table permanent.
Question 6To increase the size of a column in an existing table, use command ALTER TABLE.
Question 7To remove table data as well table structure, use command DROP TABLE.
Question 8To define a column as a primary key, primary key constraint is used in CREATE TABLE.
Question 1Consider the following SQL statement. What type of statement is this ?CREATE TABLE employee (name VARCHAR, id INTEGER)DMLDDLDCLIntegrity...
Question 2The data types CHAR(n) and VARCHAR(n) are used to create ..............., and ............... length types of string/text fields in a...
Question 3A table Table1 has two text fields defined as below :: Name1 varchar(20), Name2 char(20), : If Name1 stores value as 'Ana' and Name2...
Question 4Consider the following SQL statement. What type of statement is this ?INSERT INTO instructor VALUES (10211, 'Shreya' , 'Biology', 66000 )...
Question 5In the given query which keyword has to be inserted ?INSERT INTO employee ............... (1002, Kausar, 2000) ;TableValuesRelationField
Question 6Which of the following is/are the DDL statements ?CreateDropAlterAll of these
Question 7In SQL, which command(s) is(are) used to change a table's structure / characteristics ?ALTER TABLEMODIFY TABLECHANGE TABLEAll of these
Question 8Which of the following commands will delete the table from MYSQL database ?DELETE TABLEDROP TABLEREMOVE TABLEALTER TABLE
Question 9............... defines rules regarding the values allowed in columns and is the standard mechanism for enforcing database...
Question 10Fill in the blank :............... command is used to remove primary key from a table in SQL.updateremovealterdrop
Question 11Which command defines its columns, integrity constraint in create table :Create table commandDrop table commandAlter table commandAll of...
Question 12Which command is used for removing a table and all its data from the database :Create table commandDrop table commandAlter table...
Question 13Which of the following is not a DDL command ?UPDATETRUNCATEALTERNone of these
Question 14Which of the following is not a legal constraint for a CREATE TABLE command ?Primary keyForeign keyUniqueDistinct
Question 1Constraints can be defined with CREATE TABLE command.
Question 2Constraints can only be defined with CREATE TABLE command.
Question 3Unique and Primary key constraints are the same.
Question 4DELETE from <table> command is same as DROP TABLE command.
Question 5Conditional updates in table data are possible through UPDATE command.
Question 1What are different divisions of SQL and commands ? Give examples of commands in each division.
Question 2What is foreign key ? How do you define a foreign key in your table ?
Question 3How is FOREIGN KEY commands different from PRIMARY KEY command ?
Question 4How is FOREIGN KEY commands related to the PRIMARY KEY ?
Question 5How do you enforce business rules on a database ?
Question 6What are table constraints ? What are column constraints ? How are these two different ?
Question 7What is default value ? How do you define it ? What is the default value of column for which no default value is define ?
Question 8(i)Differentiate between DROP TABLE, DROP DATABASE.
Question 8(ii)Differentiate between DROP TABLE, DROP clause of ALTER TABLE.
Question 1Insert all those records of table Accounts into table Pending where amt_outstanding is more than 10000.
Question 2Increase salary of employee records by 10% (table employee).
Question 3Give commission of Rs.500 to all employees who joined in year 1982 (table Empl).
Question 4Allocate the department situated in BOSTON to employee with employee number 7500 (tables EMPL, Dept)
Question 5Given the following tables :Orders (OrdNo, Ord_date, ProdNo#, Qty) Product (ProdNo, Descp, Price) Payment (OrdNo, Pment) Write a query to...
Question 6Enlist the names of all tables created by you.
Question 7Write Query statements for following transaction : (Consider tables of question 12)Increase price of all products by 10%.List the details...
Question 8Modify table Empl, add another column called Grade of VARCHAR type, size 1 into it.
Question 9In the added column Grade, assign grades as follows :if sal is in range 700 — 1500, Grade is 1 ;if sal is in range 1500 — 2200, Grade is 2...
Question 10Add a constraint (NN-Grade) in table Empl that declares column Grade not null.
Question 11Insert a record of your choice in table Empl. Make sure not to enter Grade.
Question 12Modify the definition of column Grade. Increase its size to 2.
Question 13Drop the table Empl.
Question 14Create the table Department table based on the following table instance chart.Column NameIDNameData TypeNUMBERVARCHARLength825
Question 15Populate the table Department with data from table dept. Including only required columns.
Question 16Create the table Employee based on the following table instance chart.Column NameData...
Question 17Drop table Employee and Department.
Question 18Create table Customer as per following Table Instance Chart.Column NameData...
Question 19Add one column Email of data type VARCHAR and size 30 to the table Customer.
Question 20Add one more column CustomerIncomeGroup of datatype VARCHAR(10).
Question 21Insert few records with relevant information, in the table.
Question 22Drop the column CustomerIncomeGroup from table Customer.
Question 23Create table Department as per following Table Instance Chart.Column NameDeptIDDeptNameKey TypePrimary Nulls/Unique NOT...
Question 24Create table Employee as per following Table Instance Chart.Column NameEmpIDEmpNameEmpAddressEmpPhoneEmpSalDeptIDKey TypePrimary...
Question 25View structures of all tables created by you.