Question

A state-wide land tax assessment database has two tables: LandParcel that stores a set of land parcels, and ZoningTypes that stores a set of zoning codes and zoning types. The LandParcel table has 5 columns ParcelNumb as text indicating each parcels unique number defined by the State, Zoning as an integer number indicating the numerical code of a zoning type and each land parcel belongs to one zoning type, Owner First Name and Owner Last Name as text indicating the owner name of a parcel, and AssessedValue as a double number indicating the value (in US dollars) of a land parcel. The ZoningTypes table has 2 columns: Code as arn integer number indicating the code of a zoning type, and Type as text indicating the full text description of zoning codes. Zoning codes and types are regulated by State government and the same set of codes and types are used in the database Table Name: LandParcel Table Name: ZoningT ParcelZoning Assessed Code Owner Last Name Peter Campbell Widseler Widseler Owner First Name Type Numb 673-101 673-103 Value 22000 545500 oel ave Dave Shella Residential ommercial Industrial Governmental 6 6 4 350000 249000 673-201 Question 3. Write ONE SQL statement to find the zoning type(s) of the parcel(s) that are owned by people whose last name is Widseler. Return the parcel number, zoning type and full owner name in the result of the SQL query (1 point) Question 4. Write ONE SQL statement to find the parcels that owned by Jessica Smith and the assessed value is less than 100000. Return the owner name and the assessed value in the result. (1 point) Question 5. Write ONE SQL statement to find the code of zoning type Agricultural. Return the code and type in the result. (1 point) Question 6. Write ONE SQL statement to find the land parcels that have assessed value $10000 or lower or the parcels that are not in zone type (code) 2 and 3. Return all the columns in the query result. (1 ponit)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

In the database you uploaded, it contains white space. In database generally there's no space between the words like Parcel and Number. So in the queries I am ignoring the space. You can either have it like OwnerFirstName or can use _ as Owner_First_Name.

You may use <> instead of != for checking not equal to condition.

The queries are as follows:

(3). Query: SELECT ParcelNumb, Type, Concat(OwnerFirstName, ' ', OwnerLastName) as OwnerName from LandParcel l, ZoningTypes z where l.Zoning=z.Code AND OwnerLastName='Widseler';

Description: In this query, we have to display columns from 2 tables so we will require a join. The join will be done on Zoning and Code columns of respected tables.

The next thing is, we need to concat the two columns content so concat() is the function needed here. This function will give the result as owner name. There's one more thing we need to check which is the last name of owner. So this will also go in where clause. Both the conditions must satisfy in order to get the results so AND clause is needed in between the 2 conditions.

(4). Query: SELECT Concat(OwnerFirstName, ' ', OwnerLastName) as OwnerName, ParcelNumb from LandParcel where OwnerFirstName='Jessica' AND OwnerLastName='Smith' AND AssessedValue<100000;

Description: Here the query will not return any rows as it does not have any matching criteria in the 4 lines. This query requires to deal with only LandParcel table so we won't have any join there. The query needs to find the owner so owner's first and the last name is checked in the query's where clause and the assessed value is also checked in it. As all the conditions are necessary, it will have AND clause everywhere.

(5). Query: SELECT Code, Type from ZoningType where Type='Agricultural';

Description: Here you need to find code and the type of the zone where the type is Agricultural. So this deals with ZoningType table and where clause will have one condition.

(6). Query: SELECT * from LandParcel where AssessedValue<=10000 OR (Zoning!=2 AND Zoning!=3);

Description: Here you need to write a query for which the Assessed value is at max 10000. This deals with LandParcel table. The other condition is having 'or' in the question itself. So, we will also use 'OR' clause here. And the next thing is, zoning column is having the value of zone code. And we need to check it is neither 2 nor 3.

So, I've used AND clause here for combine checking this. So the query is checking either for assessed value or for the combination of those conditions zoning!=2 and zoning!=3.

Do comment if there is any query. Thank you. :)

Add a comment
Know the answer?
Add Answer to:
A state-wide land tax assessment database has two tables: LandParcel that stores a set of land...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create the database and tables for the database. Show all SQL statements. Include primary and foreign...

    Create the database and tables for the database. Show all SQL statements. Include primary and foreign keys. Insert data into each table. Show select statements and display the output of each table. Note:Student’s name must be inserted into table as part of the data! Perform the SQL below: Query one table and use WHERE to filter the results. The SELECT clause should have a column list, not an asterisk (*). State the purpose of the query; show the query and...

  • This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the...

    This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the following attributes: MPROPERTY (Property_ID, Owner_ID, Owner_Name, Owner_email, Owner_type) Property_ID is the id of property owned by an owner (assume one property can be owned by one owner only) Owner_ID is the ID of Owner Owner_name is name of the owner Owner_email is the e-mail of the owner Owner_type is type of owner (individual, corporate or Partnership) MEMPLOYEE (Employee_ID, Last_name, First_Name, CellPhone, ExperienceLevel) EMPLOYEE_ID is...

  • This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the...

    This is for SQL Database (Oracle) I have three tables MPROPERTY, MEMPLOYEE, and MSERVICE with the following attributes: MPROPERTY (Property_ID, Owner_ID, Owner_Name, Owner_email, Owner_type) Property_ID is the id of property owned by an owner (assume one property can be owned by one owner only) Owner_ID is the ID of Owner Owner_name is name of the owner Owner_email is the e-mail of the owner Owner_type is type of owner (individual, corporate or Partnership) MEMPLOYEE (Employee_ID, Last_name, First_Name, CellPhone, ExperienceLevel) EMPLOYEE_ID is...

  • The following tables form part of a database held in a relational DBMS: Hotel (hotelNo, hotelName,...

    The following tables form part of a database held in a relational DBMS: Hotel (hotelNo, hotelName, city) Room (roomNo, hotelNo, type, price) Booking (hotelNo, guestNo, dateFrom, dateTo, roomNo) Guest (guestNo, guestName, guestAddress) where Hotel contains hotel details and hotelNo is the primary key; Room contains room details for each hotel and (roomNo, hoteINo) forms the primary key; Booking contains details of bookings and (hoteINo, guestNo, dateFrom) forms the primary key; Guest contains guest details and guestNo is the primary key....

  • Question 2 (60 points): You need the Sales OrdersExample database to complete this project. To install...

    Question 2 (60 points): You need the Sales OrdersExample database to complete this project. To install the database, first, download Data code 1 and run it, then download Data code 2 and run (provided on D2L). Now answer the following questions. 2.1: (20 Points) Use the customers' table inside of the salesordersexample database, and write a query statement to show records from the CustFirstName, CustLastName, and CustCity columns 2.2: (20 Points) Use the employees' table inside of the salesordersexample database,...

  • Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary...

    Exercise 3 [12.5 marks] Given the Restaurant management system database that contains the following tables (primary keys are underlined and foreign keys are preceded with #): Customer (customerID,customerFirstName,customerLastName,customerAddress) Oreder (orderID,orderDate, #customerID,#menuItemID,#staffID) MenuItem(menuItemID, menuItemName,ingredients,type,availability) Staff(staffID, staffName, staffPhoneNumber, staffRole ) OrderPayment(paymentID,paymentAmount,#orderID,#staffID) 1) Without using DISTINCT, write the SQL query equivalent to the following one:[1.5 marks] SELECT DISTINCT menuItemName FROM MenuItem WHERE type = ‘Vegetarian’ OR availability= ‘Yes’; 2) Express the following queries in SQL: a) Find the number of orders placed by...

  • WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the...

    WRITE A SQL QUERY SQL SERVER Write a SELECT statement that returns one column from the Customers table named FullName that joins the LastName and FirstName columns. --       Format this column with the last name, a comma, a space, and the first name like this: --       Doe, John --       Sort the result set by last name in ascending sequence. --       Return only the contacts whose last name begins with a letter from M to Z. --  ...

  • For this set of Review Questions, we will create and use a database for the Wedgewood...

    For this set of Review Questions, we will create and use a database for the Wedgewood Pacific Corporation (WPC) that is similar to the Microsoft Access database we created and used in Chapters 1 and 2. Founded in 1957 in Seattle, Washington, WPC has grown into an internationally recognized organization. The company is located in two buildings. One building houses the Administration, Accounting, Finance, and Human Resources departments, and the second houses the Production, Marketing, and Information Systems departments. The...

  • Write an SQL query to list those properties that have never been sold. Design Tip When a property has sold, its information can be found in Sales table and vice versa. List each property with the foll...

    Write an SQL query to list those properties that have never been sold. Design Tip When a property has sold, its information can be found in Sales table and vice versa. List each property with the following four columns: property_id, primary_purpose, locality, and the area. Name the area coulmn as "Area". (Since the dataset might be incomplete, return "N/A" when the area is unknown for a property.) So the problem I got is that I got very similar output as...

  • What happens when you try to compile and run the following code? String query = "INSERT...

    What happens when you try to compile and run the following code? String query = "INSERT INTO Invoices (InvoiceDate InvoiceTotal) "              + "VALUES ('2/10/01', '443.55')"; Statement statement = connection.createStatement(); statement.executeUpdate(query); a. A SQLException is thrown at runtime because the executeUpdate method can’t accept a String object. b. A SQLException is thrown at runtime because the SQL statement is coded incorrectly. c. An error occurs at compile time because the SQL statement is coded incorrectly. d. This code compiles and...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT