Tut 6 With Answer
Tut 6 With Answer
1. Write a database description for each of the relations shown, using SQL DDL (shorten,
abbreviate, or change any data names, as needed for your SQL version). Assume the
following attribute data types:
StudentID (integer, primary key), StudentName (25 characters), FacultyID (integer,
primary key), FacultyName (25 characters), CourseID (8 characters, primary key),
CourseName (15 characters), DateQualified (date), SectionNo (integer, primary key),
Semester (7 characters)
FROM Question >=2, use table above to write SQL Query, Faculty has the same meaning as
Instructor.
2. Create an SQL VIEW for following table
3. Write SQL data definition commands for each of the following queries:
a. How would you add an attribute: Class - Varchar(5), to the Student table?
c. How would you change the FacultyName field from 25 characters to 40 characters?
a. Create two different forms of the INSERT command to add a student with a student ID
of 65798 and last name Lopez to the Student table.
b. Now write a command that will remove Lopez from the Student table.
c. Create an SQL command that will modify the name of course ISM 4212 from Database
to Introduction to Relational Databases.
5. Write SQL queries to answer the following questions:
c. What is the smallest section number used in the first semester of 2008?
a. How many students are enrolled in Section 2714 in the first semester of 2008?
b. Which faculty members have qualified to teach a course since 1993? List the faculty ID
only.
a. What are the courses included in the Section table? List each course only once.
DATEQUALIFIED DATE,
3.
4.
5.
6.