Sumita Arora Solution

What is the purpose of DROP TABLE command in MySQL? How is it different from DELETE command?

DROP TABLE is Data Definition Language (DDL) Command which is used to delete entire table including all schema (structure and constraints) and records. DROP TABLE DELETE Delete entire schema Delete records only WHERE clause can not be used WHERE clause can be used It is DDL It is DML

What is the purpose of DROP TABLE command in MySQL? How is it different from DELETE command? Read More »

What are table constraints? What are column constraints? How are these two different?

Table constraints are validations which can be applied on a group of columns of the table. For exp – CHECK, UNIQUE etc. Column level constraints are validations which can be applied on individual columns of the tables. For exp – NOT NULL, DEFAULT etc. Table Constraints Column Constraints It appears at the end of table

What are table constraints? What are column constraints? How are these two different? Read More »

What is Foreign key? How do you define a Foreign key in your table?

The common field which is Primary key in another related table is called Foriegn key. Foriegn key is a constraint which ensures that relationship between records in related tables are valid and user can not delete or update related data accidently.We can define Foreign key in two ways- 1) Using CREATE TABLE- FOREIGN KEY <column

What is Foreign key? How do you define a Foreign key in your table? Read More »

Write SQL commands for the following in the basis of given table STUDENT.

(a) Select all the Nonmedical stream students from STUDENT1.(b) List the name of those students who are in class 12 sorted by Stipend.(c) List all student sorted by AvgMark in descending order. Ans: (a) SELECT * FROM STUDENT WHERE STREAM = “Nonmedical”; (b) SELECT NAME FROM STUDENT WHERE CLASS LIKE “12%” ORDER BY STIPEND; (c)

Write SQL commands for the following in the basis of given table STUDENT. Read More »

Write SQL commands for the following on the basis of given table Club.

(a) To show all information about the swimming coaches in the club(b) To list names of all coaches with their date of appointment (DATEOFAPP0 in descending order.(c) To display a report, showing coachname, pay, age and bonus (15% of pay) of all the coaches. Ans: (a) SELECT * FROM CLUB WHERE SPORT = “Swimming”; (b)

Write SQL commands for the following on the basis of given table Club. Read More »

Consider the following table FITNESS with details about fitness products being sold in the store.

Write command of SQL for(i) To display the names of all the products with price more than 20000(ii) To display the names of all products by the manufacturer “Aone”(iii) To change the price data of all the products by applying 25% discount reduction.(iv) To add a new row for product with the details: “P7”, “Vibro

Consider the following table FITNESS with details about fitness products being sold in the store. Read More »

Consider the following table named “GYM” with details about fitness items being sold in the store.

Write commands of SQL for(i) To display the names of all the items whose name starts with “A”(ii) To display ICODEs and INAMEs of all items, whose Brandname is Reliable or Coscore(iii) To change the Brandname to “Fit Trend India” of the item, whose ICODE as “G101”.(iv) Add a new row for new item in

Consider the following table named “GYM” with details about fitness items being sold in the store. Read More »

error: Content is protected !!