SQL Practice
1. Write a database description for each of the relations shown, using SQL DDL.
Assume the following attribute data types:
2. Use SQL to define the following view: STU_ID STU_NAME
38214
54907
54907
66324
Letersky
Altvater
Altvater
Aiken
3. Before any row can be entered in the SECTION table, the COURSE_ID to be entered must already exist in the COURSE table. Write an SQL assertion that will enforce this constraint.
4. Write SQL definition commands for each of the following queries:
a. How would you add an attribute, CLASS, to the STUDENT table?
b. How would you remove the IS_REGISTERED table?
c. How would you change the field for FACULTY_NAME from 25 characters to 40 characters?
5. Create an SQL command that will modify the name of course ISM 4212 from
‘Database’ to ‘Introduction to Relational Database’.
6. Write SQL queries to answer which students have an ID number that is less than
50000?
7. Write SQL queries to answer which faculty members have qualified to teach a course since 1993? List the faculty ID, course, and date of qualification.
8. Write SQL queries to answer which students are enrolled in Database and
Networking?
9. Write SQL queries to list the courses available. Group them by course prefix.
1. Write a database description for each of the relations shown, using SQL DDL.
Assume the following attribute data types:
2. Use SQL to define the following view: STU_ID STU_NAME
38214
54907
54907
66324
Letersky
Altvater
Altvater
Aiken
3. Before any row can be entered in the SECTION table, the COURSE_ID to be entered must already exist in the COURSE table. Write an SQL assertion that will enforce this constraint.
4. Write SQL definition commands for each of the following queries:
a. How