CMSC 424 SQL Midterm(100% correct answers)
RDBMS acronym correct answers relational database management system RDBMS attributes correct answers data stored in tables, relationships represented by common values such as primary keys and foreign keys 3 benefits of having the SQL standard correct answers reduced training costs, productivity, application portability, application longevity, reduced dependence on a single vendor, cross-system comms 3 categories of SQL commands correct answers DDL(definition), DML(manipulation), DCL(control) DDL correct answers create, alter, drop tables DML correct answers update, insert, query DCL correct answers control database, so give permissions/ privileges create the following tables: STUDENT: id, name, dept_name(FK), tot_cred, advisor_id// Some advisor_id values above will be NULL DEPARTMENT: dept_name, building, budget, created INSTRUCTOR: id, name, dept_name(FK), salary COURSE: course_id, title, dept_name(FK), credits correct answers CREATE TABLE department (dept_name VARCHAR(25) NOT NULL, building VARCHAR(30) NOT NULL, budget decimal(10,2), created date DEFAULT '', CONSTRAINT dep_pk primary key(dept_name)) engine = innoDB; CREATE TABLE course(course_id VARCHAR(25) NOT NULL, title VARCHAR(40), dept_name VARCHAR(25), credits int, CONSTRAINT course_pk primary key(course_id), CONSTRAINT dept_pk foreign_key(dept_name) REFERENCES department(dept_name); CREATE TABLE instructor(id int NOT NULL, name VARCHAR(50), dept_name VARCHAR(25), salary decimal(8,2), CONSTRAINT id_pk PRIMARY KEY(id), CONSTRAINT dept_fk FOREIGN KEY(dept_name) REFERENCES department(dept_name)); CREATE TABLE student(id int NOT NULL, name varchar(25), dept_name VARCHAR(25), tot_cred int, advisor_id int, CONSTRAINT id_pk PRIMARY KEY(id),
Written for
- Institution
- CMSC 424
- Course
- CMSC 424
Document information
- Uploaded on
- May 23, 2024
- Number of pages
- 7
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
Also available in package deal