PGoCareerGoCareer prep tools
LoginSign up
  • Java
  • Python
  • AI
  • React
  • Angular
  • PHP
  • Node.js
  • SQL
  • DSA
  • HTML
  • CSS
  • JS
  • Spring
  • ML
  • MongoDB

SQL · Theory

SQL Interview

← All stacks

Theory

115/439

SQL Interview

A view is a saved SELECT with a name. CREATE VIEW fail_list AS SELECT name, marks FROM students WHERE marks < 40; Then SELECT * FROM fail_list; looks like a table but it runs that query each time (simple views).

Teachers like views for ‘show only what this role should see’. You don’t copy data. If students.marks changes, fail_list changes.

Some views are not updatable (JOIN, GROUP BY). INSERT into fail_list may fail. Don’t promise ‘views always write back’.

Trap — thinking a view stores a snapshot forever. Unless you made a table, it is a query with a nickname.

On the example next to this theory: Interview: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

On the example next to this theory: SQL Interview: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Exam tip

CREATE VIEW fail_list AS SELECT … WHERE marks < 40;

SQL Interview — sample query

-- SQL Interview
CREATE TABLE demo (
  id INTEGER PRIMARY KEY,
  label TEXT NOT NULL,
  qty INTEGER DEFAULT 0
);
INSERT INTO demo (id, label, qty) VALUES
  (1, 'alpha', 2),
  (2, 'beta', 5);
SELECT label, qty FROM demo WHERE qty >= 2 ORDER BY qty DESC;

SQL Interview: create two demo rows, then SELECT qty >= 2 ordered. Say which labels come back.

Short notes

  • DefView = named SELECT. Looks like a table.
  • RuleData stays in base tables. View refreshes with them.
  • TrapAssuming every view can INSERT/UPDATE.

Questions

1

What is a view?

2

Can you always UPDATE a view?

115 / 439

P

GoCareerGo

Utilities · Preparation Hub · Resume · CV · Tools — one workspace.

Workspace

DashboardProfilePreparation HubResume builderCV builderCareer planning

PDF Tools

Merge PDFSplit PDFCompress PDFImage to PDFAll toolsJobs

Image & QR

Compress ImageResize ImageQR ScannerQR GeneratorBlogIT interview prep

Company

FAQFeedbackContactPrivacyTermsSitemap

© 2026 GoCareerGo. Keep moving forward.