Task 10: List all the tables contained within the system catalog, but only display the first 10 records with a TABLE_TYPE of SYSTEM VIEW.
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.
I am having issues with Lab 7 1 KimTay Pet Supplies tasks 10,11,12 ,and 21
Task 10: List all the tables contained within the system catalog, but only display the first 10 records with a TABLE_TYPE of SYSTEM VIEW.
My code:
SELECT TABLE_NAME, TABLE_TYPE
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'SYSTEM VIEW'
LIMIT 10;
Task 11: List all the columns contained within the system catalog, but only display the first 11 records that are in the KimTay TABLE_SCHEMA.
My code:
SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_SCHEMA = 'KimTay'
LIMIT 11;
Task 12: List all the views contained within the system catalog, but only display the first 12 records.
My code :
SELECT *
FROM INFORMATION_SCHEMA.VIEWS
ORDER BY TABLE_SCHEMA, TABLE_NAME
LIMIT 12;
Task 21: Alter the INVOICE_LINE table by adding the INVOICE_NUM column as a foreign key referencing the INVOICE_NUM column in the INVOICES table.
My code:
ALTER TABLE INVOICE_LINE
ADD CONSTRAINT FK_INVOICE_LINE_INVOICES
FOREIGN KEY (INVOICE_NUM) REFERENCES INVOICES(INVOICE_NUM);
SQL
SQL Database Test Complete Complete task 21 - INVOICE_NUM column is listed is set as the foreign key
Thank you for your time I would really appreciate it
Trending now
This is a popular solution!
Step by step
Solved in 3 steps