Question

What SQL syntax would you use to change data in a table if you only had...

What SQL syntax would you use to change data in a table if you only had read access to the table? Having read access means the data manipulation would occur in the dataset rather than in the table being pulled from.

Homework Answers

Answer #1

Solution:

Sometimes the database administrator wants to restrict direct access to the database. For example, if a table contains various columns, but the user only needs 3 columns of data in such case DBA will create a virtual table of 3 columns. For both purposes, you can use the view. Views can act as a proxy or virtual table and we can do changes in that table. Views reduce the complexity of SQL queries and provide secure access to underlying tables.

View: Views are a special version of tables in SQL. They provide a virtual table environment for various complex operations. You can select data from multiple tables, or you can select specific data based on certain criteria in view. It does not hold the actual data; it holds only the definition of the view in the data dictionary.

The view is a query stored in the data dictionary, on which the user can query just like they do on tables. It does not use physical memory, only the query is stored in the data dictionary. It is computed dynamically, whenever the user performs any query on it. Changes made at any point in view are reflected in the actual base table.

The view has primarily two purposes:

  • Simplify the complex SQL queries.
  • Provide restrictions to users from accessing sensitive data.

Types of Views:

  • Simple View: A view based on only a single table, which doesn't contain GROUP BY clause and any functions.
  • Complex View: A view based on multiple tables, which contain GROUP BY clause and functions.

  • Inline View: A view based on a subquery in FROM Clause, that subquery creates a temporary table and simplifies the complex query.

  • Materialized View: A view that stores the definition as well as data. It creates replicas of data by storing it physically.

Advantages of views:

  • Views can be utilized as a subset of actual data to perform certain operations.
  • It helps us to provide an abstraction to various users or hide the complexity for users who are accessing data from the table.
  • It also simplifies data access from multiple joined tables. It can be used as aggregated tables using group by operations.
  • It does not hold any space because it only has the definition in the data dictionary, not the copy of actual data.

Disadvantages of view:

  • Views have a dependency on the table structure.
  • It has a dependency on base table structure dependency, computation time, and restrictions.

.....

Thanks!

Know the answer?
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
Similar Questions
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How...
A Guide to SQL Questions 1. How do you create a table using SQL? 2. How do you delete a table using SQL? 3. What are the common data types used to define columns using SQL? 4. Identify the best data type to use to store the following data in Oracle, in SQL Server, and in Access:    a. The month, day, and year that an employee was hired    b. An employee’s Social Security number    c. The department...
SQL: Assume the table below was identified during a normalization activity. What command would I type...
SQL: Assume the table below was identified during a normalization activity. What command would I type to create this table -- assuming the 'TypeDesc' column was required? (i.e: not allowed to having missing values).   Assume that the possible Type Codes are H, C, W, M, P, S. (Don't worry about inserting the data. Make reasonable assumptions about the datatypes.) Table Name : Type TypCode TypeDesc H Home C Cell W Work M Mobile P Parent S Spouse
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table....
Lab 5 Queries with Multiple Tables In this lab, we do queries more than one table. SQL provides two different techniques for querying data from multiple tables: • The SQL subquery • The SQL join As you will learn, although both work with multiple tables, they are used for slightly different purposes. We used WMCRM database which is what we created in Lab 4. Here is the summary of the database schema (where schema is used in its meaning of...
What critical value t* from the t-table would you use for a confidence interval for the...
What critical value t* from the t-table would you use for a confidence interval for the mean of the population in each of the following situations? NOTE: The critical value is just another name for the t* values we read off from the type of T Table you have in your notes. (Use 3 decimal places) (a) A 95% confidence interval based on 4 observations (b) A 99% confidence interval from an SRS of 9 observations (c) An 90% confidence...
would you use a frequency table or relative frequency table to generate data for patients seen...
would you use a frequency table or relative frequency table to generate data for patients seen in a doctors office and their wait time
What is one example where you would use grouping to summarize data In this example, if...
What is one example where you would use grouping to summarize data In this example, if you have any filtering criteria would you use the "Where" clause or the "Having" clause and why?
Consider the following problem domain. What sort of data store (mongodb vs an enterprise grade sql...
Consider the following problem domain. What sort of data store (mongodb vs an enterprise grade sql database like mysql) should you use and why? Your domain: You are building a web based user interface to allow people to play fantasy sports team games. Your data store (mongo or mysql) will store all of the data needed for your fantasty sports league of choice (clearly you need to specify your sport since competitive table tennis [a thing in other parts of...
What type of chart would you use if you had data collected over time? a. X-bar/R...
What type of chart would you use if you had data collected over time? a. X-bar/R chart b. p chart c. Too vague to answer d. c chart
From everything you read, analyzed and understand to date about Starbucks, what would you change that...
From everything you read, analyzed and understand to date about Starbucks, what would you change that would help it increase revenue, control its expenses, or make its assets more efficient? Show how that beneficial change would affect at least one ratio.
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects....
Summary The Ch08_ConstructCo database stores data for a consulting company that tracks all charges to projects. The charges are based on the hours each employee works on each project. The structure and contents of the Ch08_ConstructCo database are shown in Figure P8.1. Use this database to answer the following problems. Database Schema The schema for the Ch08_ConstructCo database is shown below and should be used to answer the next several problems. Click this image to view it in its own...