Question: a . Write a SQL column definition for BankBalance ( just for one column, don't worry about the rest of the table ) that ensures

a. Write a SQL column definition for BankBalance (just for one column, don't worry about the rest of the
table) that ensures that balance must be between 0 and 29.99(column definition should enforce both the
number precision and greater-than-0 requirement).
b. Write a SQL column definition for Street (just for one column, don't worry about the rest of the table) that
ensures that the street address is up to 34 characters and has to start from 'Nor' (hint: CHECK constraint can
use LIKE operator).
c. The following set of relations records information about university students, courses and assigned grades. The
Student relation contains information about the student, including the name (full name is stored in one column),
address and their year of graduation. The Course relation records information about courses: course name
(primary key), course department and the number of credits provided by the course. Finally, the Grade relation
records information about the grades given; CName is the foreign key referring to the primary key of the Course
relation and StudentID is the foreign key referring to the primary key of the Student relation. The grades are a
numeric value given on a 4-point system.
Student(StudentID, Name, Address, GradYear)
Grade(CName, StudentID, CGrade)
Course(CName, Department, Credits)
For each part below, write a single SQL query.
Q1. Display the list of student IDs and names for the students who graduated in the most recent year. You can assume that
GradYear is an integer, but your query is not allowed to assume any particular year.
Q2. Display student names and their taken course names for all students with the middle name of 'Stevo. You may assume that
name is always written as 'First Middle Last'. Your query output should be sorted by grade.
Q3. For students who are either not enrolled in any courses or are enrolled in only 1 course, list those student's names and
graduation years.
Q4. Update all student records, to increase the graduation year by 6 for all students who live in Chicago.
Q5. Modify the course table to add a Chair column that can be up to 32 characters (that question requires a DDL rather than a
DML SQL statement)
 a. Write a SQL column definition for BankBalance (just for one

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!