List all painting titles with price greater than 5000$. How many paintings does ‘Ross Georgette’ have? Find the title of paintings that displayed on ‘L. R. Gilliam’ gallery.
SQL
SQL stands for Structured Query Language, is a form of communication that uses queries structured in a specific format to store, manage & retrieve data from a relational database.
Queries
A query is a type of computer programming language that is used to retrieve data from a database. Databases are useful in a variety of ways. They enable the retrieval of records or parts of records, as well as the performance of various calculations prior to displaying the results. A search query is one type of query that many people perform several times per day. A search query is executed every time you use a search engine to find something. When you press the Enter key, the keywords are sent to the search engine, where they are processed by an algorithm that retrieves related results from the search index. Your query's results are displayed on a search engine results page, or SER.
PLZ help with the followng:
-
List all painting titles with price greater than 5000$.
-
How many paintings does ‘Ross Georgette’ have?
-
Find the title of paintings that displayed on ‘L. R. Gilliam’ gallery.
CREATE TABLE GALLERY (
GAL_NUM char(4),
GAL_OWNER varchar(35),
GAL_AREACODE char(3),
GAL_PHONE char(8),
GAL_RATE number
);
INSERT INTO GALLERY VALUES('5','L. R. Gilliam','901','123-4456',0.37);
INSERT INTO GALLERY VALUES('6','G. G. Waters','405','353-2243',0.45 );
INSERT INTO GALLERY VALUES('1','N. D. Cosner','203','123-9956',0.67);
INSERT INTO GALLERY VALUES('2','S. H. Artwork','415','154-3243',0.30);
/* -- */
CREATE TABLE PAINTER (
PTR_NUM char(4),
PTR_LASTNAME varchar(15) NOT NULL,
PTR_FIRSTNAME varchar(15) NOT NULL,
PTR_AREACODE char(3),
PTR_PHONE char(8)
);
INSERT INTO PAINTER VALUES('123','Ross','Georgette','901','885-4567');
INSERT INTO PAINTER VALUES('126','Itero','Julio','901','346-1112');
INSERT INTO PAINTER VALUES('127','Geoff','George','615','221-4456');
/* -- */
CREATE TABLE PAINTING (
PTNG_NUM char(4),
PTNG_TITLE varchar(35),
PTNG_PRICE number,
PTR_NUM char(4),
GAL_NUM char(4)
);
INSERT INTO PAINTING VALUES('1338','Dawn Thunder',245.5,'123','5');
INSERT INTO PAINTING VALUES('1339','A Faded Rose',6723,'123','1');
INSERT INTO PAINTING VALUES('1340','The Founders',567.99,'126','6');
INSERT INTO PAINTING VALUES('1341','Hasty Pudding Exit',145.5,'123','');
INSERT INTO PAINTING VALUES('1342','Plastic Paradise',8328.99,'126','6');
INSERT INTO PAINTING VALUES('1343','Roamin''',785,'127','6');
INSERT INTO PAINTING VALUES('1344','Wild Waters',999,'127','5');
INSERT INTO PAINTING VALUES('1345','Stuff ''n Such ''n Some',9800,'123','5');
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 6 images