Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following relational schema is given for a computer store system Store(storeID, storeName, city) Computer (computerID, modelName, price) Processor(processorID, modelName, numberOfCores, baseClockSpeed) Memory (memoryID, mode1Name,

image text in transcribed

The following relational schema is given for a computer store system Store(storeID, storeName, city) Computer (computerID, modelName, price) Processor(processorID, modelName, numberOfCores, baseClockSpeed) Memory (memoryID, mode1Name, capacity) Sells (storeID, computerID, stock) Has (computerID, processorID, memoryID) In the Store table, storeID is an integer primary key, storeName is a string that corresponds to the name of the store and city is a string that corresponds to the name of the city where the store is located in. In the Computer table, computerID is an integer primary key, modelName is a string that corresponds to the model of the computer. (There could be different entries in this table with the same model name, but with different prices and internal parts, because of this model name is not unique.) Price is an integer, that corresponds to the cost in Turkish Liras In the Processor table, processorID is an integer primary key, modelName is a string, numberOfCores is an integer that corresponds to the number of cores, baseClockSpeed is a double that corresponds to the processor speed in GHz. In the Memory table, memoryID is an integer primary key, modelName is a string, capacity is an integer that corresponds to the memory capacity in GB Sells table relates one store with a computer, storeID is a foreign key that references Store, and computerID is a foreign key that references Computer table. Stock is an integer that corresponds to the number of such computers this store sell. Has table relates one computer with one processor and memory. ComputerID is a foreign key that references Computer, processorID is a foreign key that references Processor and memoryID is a foreign key that references Memory table Write the following queries in SQL, based on the given information. 1) Find name of stores that sell computers with model name "C202SA". 2) Find model name of the cheapest computer with at least 8GB memory capacity 3) Find how many stores there are in each different city. You should project the city and the number of stores in that city. 4) Delete all computers that are not sold by any store

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beyond Big Data Using Social MDM To Drive Deep Customer Insight

Authors: Martin Oberhofer, Eberhard Hechler

1st Edition

0133509796, 9780133509793

More Books

Students also viewed these Databases questions