0% found this document useful (0 votes)
2 views

SQL_Questions_with_Images

The document contains a series of SQL questions focused on creating and manipulating database tables, specifically 'Participant', 'DOCTOR', and 'Sales'. It includes tasks such as writing queries to display table structures, filter records based on specific criteria, and modify table schemas. Additionally, it addresses cardinality and degree of tables, as well as commands for updating and deleting records.

Uploaded by

Saradha S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

SQL_Questions_with_Images

The document contains a series of SQL questions focused on creating and manipulating database tables, specifically 'Participant', 'DOCTOR', and 'Sales'. It includes tasks such as writing queries to display table structures, filter records based on specific criteria, and modify table schemas. Additionally, it addresses cardinality and degree of tables, as well as commands for updating and deleting records.

Uploaded by

Saradha S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

SQL Questions

1. Write the SQL query to create the "Participant" table with the given structure.

2. Write the command to display the tables created in a database and the command to view
the structure of the table.

3. Based on the given "DOCTOR" table:

i) Give the cardinality and degree of the table.


ii) Write SQL Query to display the details of all those Doctors whose name either starts
with ‘J’ or starts with ‘S’.
iii) Write SQL Query to display the details of all female doctors having experience more
than 5 years.
iv) Write SQL Query to add a column "ContactNo" with data type INT and size 10.

4. OR

i) Write the SQL Query to display the records of the ENT department.
ii) Write the SQL Query to update the experience of all doctors by 1.
iii) Write the SQL Query to display "Name" and "Dept" in ascending order and then by
"Experience" in descending order.
iv) Write the SQL Query to add a Primary Key to the column "ID" in the existing table.

5. Consider the "Sales" table:

a) Write a SQL query to display the name of the oldest employee first, then the 2nd oldest,
and so on.
b) Which of the following commands will display all sales where the date of joining is after
31st March 2018?
i) Select * from Sales where dateofjoin >= "31-03-2018";
ii) Select * from Sales where dojoin >= "2018-03-31";
iii) Select * from Sales where dojoin > "2018-03-31";
iv) Select * from Sales where dojoin > "2018/03/31";
c) Write a query to display "Area," "Ename" as "Employee," and "Amount*0.01" as "PF" for
employees in "East" or "West" areas.
d) Write a SQL query to delete the record of the employee with Ecode 102.
Participant Table Structure

Doctor Table Data

Sales Table Data

You might also like