
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Concept explainers
Question
Click New Query and type an SQL statement to create adatabase named myDB.
- Click the Execute button or press F5 to see the new database in the Object Explorer.
- Create queries to perform the next steps. Before writing the queries, type USE myDB; in the first line to use the database you have created in Step
- Create the tables named Customers and Product. Set the appropriate data types and determines which ones are supposed to be NOT
Customers: CustomerID (Primary key), FirstName, LastName, Email, Gender, Birthdate
Products: ProductID (Primary key), Description, Quantity, Price, VendorID
- Create another table named Vendors with columns: VendorID (Primary key), Name, ContactNum, CityAddress.
- Set VendorID from the Vendor table as a foreign key in the Products
- Save a copy of your queries since these will be used in the last laboratory session of the Pre-final period.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps

Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Similar questions
- Assume that a database has a table named Stock, with the following columns:Column Name TypeTrading_Symbol nchar(10)Company_Name nchar(25)Num_Shares intPurchase_Price moneySelling_Price moneyWrite a Select statement that returns the Trading_Symbol column only from the rows where Purchase_Price is greater than $25.00.arrow_forwardDo question 2. Create the SQL code (ONLY) that will solve the following questions. Please put all items in one query and submit. You will create only SQL query to solve all of the items below. Add the usual detailed comment and USE statement at the beginning of the query. Name the database: Quiz4query Instructions Q1. Put the solution to the following mathematical calculation into a variable "Quiz4Calc" : 3.14159265358979 * 4589.631 Note: you can use a scale or 8. Q2. Use the CONVERT function, a. Convert to integer, use the heading: “integer” b. Convert to Real with 7 significant digits, Heading: “Real” c. Convert to Float with 15-significant digits, Heading: “Float”arrow_forwardYou have given a table from a database and the name of the table is Employees Please display the following from the Employees 1) The Employee Id, Last Name and First Name for each employee in order in terms of Last Name. 2) The employees who is title is Sales Representative 3) Delete the employee whose title of courtesy is Dr. 4) Update the title of the employee whose title is Sales Manager to Senior Sales Manager.arrow_forward
- Access: Tables and Controlsarrow_forwardhow to Create three or more SQL Data Control Language (DCL) Statements using the Homework Database: EMPLOYEE, STORE, REGION, and SUPPLIER Database. Create a new user statement for the database. The user name should be based on yourself containing your name. Statements that grant privileges to the new user. Statements granting privileges to at least 2 of the tables in the assigned database Statements that revoke privileges to the new user. Statements revoking privileges to at least 2 of the tables in the assigned Database the home work data base: -- creating the RegionStore DataBase DROP DATABASE IF EXISTS RegionStore; CREATE DATABASE RegionStore; USE RegionStore; -- creating the Region table CREATE TABLE Region ( regionID VARCHAR(10), regionName VARCHAR(50), supervisor VARCHAR(50), CONSTRAINT PRIMARY KEY (regionID) ); -- creating the store table CREATE TABLE Store ( storeID VARCHAR (10), storeAddress VARCHAR (50), phone…arrow_forwardDesign your application's/organization's database. You need to create the 3 tables for each of the services offered. You must provide at least 5 examples in each of the table. There must be a table in which you have prices linked to the services you are providing. THIS IS THE NAME & DESCRIPTION OF THE ORGANIZATION FOR WHICH YOU NEED TO CREATE 3 TABLES FOR EACH SERVICE PROVIDED *Name of the Organization* :: ECOHUB *Description of the Organization* :: EcoHub is a sustainability-focused organisation that seeks to encourage environmentally friendly behaviours, increase public knowledge of environmental problems, and offer solutions for people, organisations, and communities to reduce their carbon footprint and help make the world a greener place. We think that many little individual actions can have a big influence on the environment when taken together. *Services Offered by the Organization are*1. EcoConsultancy : We provide individualised eco-consultancy services to people and…arrow_forward
- Database coursearrow_forwardScenario and Database Model: InstantRide InstantRide is the new ride sharing application in the city and it has just started its operations. With the help of the InstantRide mobile application, the users request a ride with their location. Drivers and cars are assigned to the request; and then the driver picks up the user to ride their requested location. Information for the users, drivers and cars are stored in the database as well as the travel transactions. In the USERS table, information for the users are stored with their first name, last name and email: In the DRIVERS table, all the drivers in the InstantRide are stored with their name, driving license number and check and rating information: In the CARS table, all the cars in the InstantRide system are kept with the license plate, model and year: Finally, the transactions of the rides are stored in the TRAVELS table. For each travel, start and end time with location are stored. In addition, the involved driver, car and…arrow_forwardWrite Create Table SQL statements Work Session table The table must have a primary key. The table must have appropriate foreign key constraints. Foreign keys must have the same name, datatype and size of the primary key that they refer to The following columns datatypes and sizes and named constraints must be used Column DataType Constraint WorkYear number(4) Range 2019 - 2020 WorkWeek number(2) Range 1-52 WorkHours number(4,2) Range 0.5 – 99.99 BID NUMBER(4) ,AUTHID NUMBER(4)arrow_forward
- SQL DML/DDL There are five tables describing employees of a company, departments, buildings, which department(s) an employee works in (and a percentage of the time for each), and in which building an employee works (an employee may have more than one office). The primary key of each table is the attribute(s) in capitals and underlined. The foreign keys are in italics. Other attributes are not necessarily unique.Employee (EID, Ename, Salary, Start_Date, End_Date)Building (BID, Bname, Address)Department (DID, Dname, Annual_Budget)In_Department (EID, DID, Percentage_Time)In_Building (EID, BID)Write the SQL statements for the following.1. Find the names of Departments where NO employees work. 2. For employees who are still working in the company, end date has no value (empty). For those who have left the company and have end date values, show their names and the duration of their employment in years. 3. Find the names of buildings where more than 50 employees work. 4. The tables have…arrow_forwardTask 2: The Driver Relationship team wants to arrange workshops and education materials to the drivers. However, the team wants to create clusters of the drivers based on their experience in InstantStay. To collect these detail, you will need to create a SQL function called DRIVER_STATUS to determine the level of the driver as follows: MASTER: more than 4 travels PRO: more than 2 travels ROOKIE: 2 or less travels In addition, run the function to verify it works as expected and send them back the driver levels. Task: Create the DRIVER_STATUS function to create clusters of drivers based on experience.arrow_forwardThe database should contain the following six tables: Artists (artist_id: char(30), artist_name: char(30), artist_pop: int(5))Tracks (track_id: char(30), track_name: char(30), duration: int(10), tempo:real) Record (artist_id: char(30), track_id: char(30))Users (user_id: char(30), user_name: char(30), age: int(5), nationality: char(30), num_track_listened: int(10))Listen (user_id: char(30), track_id: char(30))Follow (user_id: char(30), artist_id: char(30), follow_date: datetime) Write a single SQL query for each request below. Find the ids of those users who have listened to at least one track but have not followed any artists. Find the ids and names of those users who have listened to some tracks recorded by the artist named 'Adele'. Find the ids and names of those users who have not listened to any track recorded by the artist named 'Adele'. Use ''NOT EXISTS'' to answer this query.arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education