DBMS Slips
Best Of Luck 👍
DBMS Slips FYMCA (Engineering)
Best Of Luck 👍
DBMS Slips FYMCA (Engineering)
query.txt) somewhere on
your PC
cursor_program.txt or simply
keep the code handy for copy-paste.
Username,
Password,
and Service Name
sqlplus username/password@xe (replace
with your
credentials)DECLARE – for declaring cursor and variablesBEGIN – to open and fetch cursorLOOP – to process each recordCLOSE – to close the cursorEND; – end of PL/SQL block/ (slash) on a new line after END;
to execute the
blockF5
Enter until you reach the slash (/) that runs
the programDBMS_OUTPUT.PUT_LINE, ensure server output is enabled:
SET SERVEROUTPUT ON; before your code
SET SERVEROUTPUT ONtrigger_program.txt
Username,
Password, and Service Name
sqlplus username/password@xeCREATE OR REPLACE TRIGGER – to define the triggerBEFORE or AFTER – depending on when you want it to
fireINSERT, UPDATE, or DELETE – the
triggering eventFOR EACH ROW – this makes it a row-level triggerBEGIN ... END; block – to specify the trigger's actionF5/ on a new line, then press
Enter
DBMS_OUTPUT, etc.)
DBMS_OUTPUT.PUT_LINE to print
messages, enable
server output:
SET SERVEROUTPUT ON; before the trigger test
SET SERVEROUTPUT ONCREATE OR REPLACE TRIGGER trg_name
BEFORE INSERT ON table_name
FOR EACH ROW
BEGIN
-- your logic here
END;
trigger.txt for
backup or future edits.
/ on a new line (after
END;) if using SQL*Plus
F5 in SQL DeveloperDELIMITER to wrap trigger logic. Example:
DELIMITER $$
CREATE TRIGGER trg_name
BEFORE INSERT ON table_name
FOR EACH ROW
BEGIN
-- your logic here
END;
$$
DELIMITER ;
DBMS_OUTPUT.PUT_LINE (in Oracle) to print messages if needed
(don’t forget
SET SERVEROUTPUT ON)
CREATE VIEW view_name AS
SELECT column1, column2
FROM table_name
WHERE condition;
create_view.txt) or keep it ready
to paste.
CREATE VIEW statement into your
SQL editor.SELECT * FROM view_name;
CREATE OR REPLACE VIEW view_name AS ...;
DROP VIEW view_name;
mongod (runs the MongoDB daemon)mongouse myDatabase;
db.students.insertOne({ name: "John", age: 22, course: "DBMS" });
db.students.find();
db.students.find({ age: 22 });db.students.find({}, { name: 1, _id: 0 });
db.students.updateOne({ name: "John" }, { $set: { age: 23 } });
db.students.deleteOne({ name: "John" });program.js)mongo program.js