Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is done in SQL view and there's a pic showing the final answer but I'm not sure how to type it out. Here's what

This is done in SQL view and there's a pic showing the final answer but I'm not sure how to type it out.

Here's what I have for question 1a.

CREATE VIEW TopLevelCust AS SELECT CustomerNum, CustomerName, Street, City, State, Zip, Balance, CreditLimit FROM Customer WHERE CreditLimit >= 10000;

-----------------------------------------------------------------------------------------------

image text in transcribed

DataBase:

image text in transcribed

Using the provided database, TAL.db, using SQLite to do the following steps 1. Define a view named TopLevelCust. It consists of the customer number, customer name, address, balance, and credit limit of all customers with credit limits that are greater than or equal to 10000 a. Using SQL, write the view definition for TopLevelCust b. Write an SQL query to retrieve all records from TopLevelCust (once this statement works, paste it notepad, so you can paste to the assignment's drop box) C. Write an SQL query to retrieve all records from TopLevelCust where the balance is less than 5000 (once this statement works, paste it notepad, so you can paste to the assignment's drop box) 2. Create a table with 4 columns, 2 character and 2 numeric datatypes (one can be INT and the other REAL). To keep thinks simple, create this table in the TAL.db database a. Implement 'legal-values-integrity' for one of the numeric types. For example, if one of the numeric columns was age, make sure the user can not insert a record where the age is less than 1 or greater than 100 Insert 3 records into your table. Test it so that you can't enter illegal values for the column where you enforced 'legal-values-integrity. b. Output for 1.b and 1.c USTOMER NUM CUSTOMER NAME S STREET CITY STATE ZIP CREDIT LIMIT 282 162 524 08 Brookings Direct 3827 Devon Grove Bargains Galore 3829 Centr Grove Kline's FL FL 838 Ridgel Fillmore FL Johnson's Depart 372 Oxford Sheldon FL 33321 33321 33336 33553 431.5 412.0 2762.015000. 2106.0 10000.0 10000.0 10000.0 USTOMER NUM CUSTOMER NAME STREET CITY STATE ZIP BALANCE CREDIT LIMIT 282 Brookings Direct 3827 Devon Grove 33321 431 10000.0

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

Step: 3

blur-text-image

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

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

fscanf retums a special value EOF that stands for...

Answered: 1 week ago

Question

3. What are potential solutions?

Answered: 1 week ago