Test Yojana

Database languages

What is Database languages

Database languages are specialized programming languages used to interact with databases. They enable users to perform various operations such as querying, updating, inserting, and deleting data from databases. There are several types of database languages, each serving specific purposes:

Type Of Daabase Languages

  • Data Definition Language (DDL)
  • Data Manipulation Language (DML)
  • Data Control Language (DCL)
  • Transaction Control Language (TCL)
  • Query Languages
  • Programming Languages with Database Connectivity

Data Definition Language (DDL):

  • DDL is used to define the structure and organization of the database schema.
  • Common DDL commands include CREATE (to create database objects like tables, indexes, and views), ALTER (to modify the structure of existing database objects), and DROP (to delete database objects).
CREATE TABLE Employees (
    EmployeeID INT PRIMARY KEY,
    FirstName VARCHAR(50),
    LastName VARCHAR(50),
    DepartmentID INT,
    Salary DECIMAL(10,2)
);

ALTER TABLE Employees
ADD COLUMN Email VARCHAR(100);

DROP TABLE Employees;

Data Manipulation Language (DML):

  • DML is used to manipulate data within the database. It includes commands for querying, inserting, updating, and deleting data.
  • The most common DML command is SQL (Structured Query Language), which is used in relational database management systems (RDBMS) like MySQL, Oracle, SQL Server, and PostgreSQL.
-- Inserting data
INSERT INTO Employees (EmployeeID, FirstName, LastName, DepartmentID, Salary)
VALUES (1, 'John', 'Doe', 101, 50000.00);

-- Updating data
UPDATE Employees
SET Salary = 55000.00
WHERE EmployeeID = 1;

-- Deleting data
DELETE FROM Employees
WHERE EmployeeID = 1;

Data Control Language (DCL):

  • DCL is used to control access to the database and its objects.
  • DCL commands include GRANT (to give users specific privileges on database objects) and REVOKE (to remove previously granted privileges).
-- Granting privileges
GRANT SELECT, INSERT, UPDATE, DELETE ON Employees TO HR_User;

-- Revoking privileges
REVOKE INSERT, UPDATE ON Employees FROM HR_User;

Transaction Control Language (TCL):

  • TCL is used to manage transactions within the database.
  • TCL commands include COMMIT (to save the changes made by a transaction), ROLLBACK (to undo the changes made by a transaction), and SAVEPOINT (to set a point within a transaction from which to roll back).
-- Starting a transaction
BEGIN TRANSACTION;

-- Making changes
INSERT INTO Employees (EmployeeID, FirstName, LastName, DepartmentID, Salary)
VALUES (2, 'Jane', 'Smith', 102, 60000.00);

-- Committing the transaction
COMMIT;

-- Rolling back changes
ROLLBACK;

Query Languages:

  • These languages are used specifically for querying databases to retrieve information.
  • SQL (Structured Query Language) is the most widely used query language, especially in relational database management systems (RDBMS).
  • Other query languages include:
    • Datalog: A declarative logic-based language used for querying and manipulating relational databases.
    • SPARQL: A query language used to retrieve and manipulate data stored in Resource Description Framework (RDF) format, commonly used in semantic web applications.
-- Basic SQL query
SELECT FirstName, LastName, Salary
FROM Employees
WHERE DepartmentID = 101;

Programming Languages with Database Connectivity:

  • These are general-purpose programming languages that provide libraries or APIs for interacting with databases.
  • Examples include:
    • JDBC (Java Database Connectivity) for Java
    • ADO.NET for .NET languages like C# and VB.NET
    • psycopg2 for Python interacting with PostgreSQL
    • mysqli for PHP interacting with MySQL

Example using Python and SQL:

import sqlite3

# Connect to the database
conn = sqlite3.connect('example.db')

# Create a cursor object
cursor = conn.cursor()

# Execute SQL query
cursor.execute('''
CREATE TABLE IF NOT EXISTS Employees (
    EmployeeID INT PRIMARY KEY,
    FirstName TEXT,
    LastName TEXT,
    DepartmentID INT,
    Salary REAL
)
''')

# Insert data
cursor.execute('''
INSERT INTO Employees (EmployeeID, FirstName, LastName, DepartmentID, Salary)
VALUES (?, ?, ?, ?, ?)
''', (1, 'John', 'Doe', 101, 50000.00))

# Commit changes
conn.commit()

# Close connection
conn.close()

    Each of these database languages serves a specific purpose in managing and interacting with databases, providing users with the flexibility and power to work with data effectively.

    These are some of the fundamental DDL commands used in SQL. They are essential for creating, modifying, and managing the structure of database objects, allowing users to define the organization and layout of their data within a database system.

    247 thoughts on “Database languages”

    1. Its like you learn my thoughts! Youu seem to grasp so much approximately this, lile you wrote the e book in it or something.
      I feel that you simply can do with a few p.c.
      to driove the message home a little bit, butt other
      than that, that is fantastic blog. A fantastic read.
      I’ll certainly be back. https://telegra.ph/7-Smartest-Strategies-to-Maximize-your-Winning-in-Online-Casinos-05-09

    2. Greetings I am so excited I found your website, I really found you by
      accident, while I was browsing on Digg for something else,
      Regardless I am here now and would just like to say many thanks
      for a marvelous ppst and a all round exciting blog (I also love the theme/design), I don’t
      have time to read through it all at the moment but I hae bookmarked it and
      also included your RSS feeds, so when I have time I will be basck to read more, Please do keep up the great work. https://663b900b63cfe.site123.me/

    3. Hello this is kinda of off topi but I waas wanting to know if blogs use WYSIWYGeditors
      or if you have to manually code with HTML. I’m starting a blog soon but have no codinng expertise soo Iwanged to get guiance from someone with experience.

      Any help would be enormously appreciated! https://band.us/band/92732543/post/3

    4. Havve yyou ever considered about including a little bit more than just yoour articles?

      I mean, what you say is valuable aand everything.
      However just imagine if you added sme great photos or video clips to give
      your posts more,”pop”! Your content is excellent
      but with pics and videos, this site could undeniably be
      one of the very best in its field. Wonderful blog! https://www.mazafakas.com/user/profile/4174542

    5. Hello there I am so grateful I found yyour blog, I really found you by error, while I was browsing on Askjeeve forr
      something else, Anyhow I am heere now and would just like to
      say kudos for a remarkablee post and a all round enjoyable
      blog (I also love thhe theme/design), I don’t have time to read it all at the minute
      but I have saved it and also included your RSS feeds, so when I have time I
      will be bback tto read more, Please do keep up the great job. https://gametrendss.mystrikingly.com/

    6. I drop a leave a response whenever I appreciate a post
      on a website or iff I have something to valuable
      to contribute to the discussion. Usually
      iit is triggered by the passion communicated in the article I read.

      And after this article Database languages – Test Yojana.
      I was moved enough to drop a comment 🙂 I do have 2 questions
      for you iif you tend not to mind. Is it simply me or do a few of
      these remarks look like they are coming from brain dead people?
      😛 And, if you are posting on additional places, I’d like
      to keep up with you. Would you mak a list every one of your community pages like your twitter feed, Facebook page or linkedin profile? https://go2trevel.mystrikingly.com/

    7. Hello would you mnd sharing which blog platform you’re using?
      I’m planning to start my own blog in the
      near future but I’m having a hard time selecting between BlogEngine/Wordpress/B2evolution and
      Drupal. The reason I ask is because your layout seems different then most blogs andd I’m looking for something completely unique.
      P.S Apologies for getting off-topic but I had to ask! https://scrapbox.io/gamings/The_10_Unmissable_Sporting_Events_that_Captivate_the_World

    8. I feel this is among the such a lot important information for me.
      Andd i am glad reading your article. However should statement on some commokn things, The web
      site style is wonderful, the articles iss truly excellent : D.

      Just right job, cheers https://www.localsoul.com/2024/05/21/%d0%be%d0%b3%d0%bb%d1%8f%d0%b4-%d0%ba%d0%b0%d0%b7%d0%b8%d0%bd%d0%be-%d0%b1%d0%b5%d1%82%d0%bc%d0%b0%d1%82%d1%87-%d1%83%d0%ba%d1%80%d0%b0%d1%97%d0%bd%d0%b0/

    9. You are so interesting! I do not suppose I’ve read something
      like that before. So wonderful to discover someone wiuth a few genuine thoughts on this topic.

      Really.. many thanks for starting this up.
      This website is one thing that is needed on the internet, someone with a
      little originality! https://www.game-frag.com/%d0%ba%d0%b0%d0%ba-%d0%b7%d0%b0%d1%80%d0%b5%d0%b3%d0%b8%d1%81%d1%82%d1%80%d0%b8%d1%80%d0%be%d0%b2%d0%b0%d1%82%d1%8c%d1%81%d1%8f-%d0%bd%d0%b0-bet-match/

    10. You absolutely know how to keep your readers interest with your witty thoughts on that topic. I was looking for additional resources, and I am glad I came across your site. Feel free to check my website Webemail24 about SEO.

    11. Hey there, I love all the points you made on that topic. There is definitely a great deal to know about this subject, and with that said, feel free to visit my blog ArticleHome to learn more about Outsourcing.

    12. Great site with quality based content. You’ve done a remarkable job in discussing. Check out my website Autoprofi about Used Car Purchase and I look forward to seeing more of your great posts.

    13. Great post! I learned something new and interesting, which I also happen to cover on my blog. It would be great to get some feedback from those who share the same interest about Aircon & Heating Services, here is my website Articlecity Thank you!

    14. Great post! I learned something new and interesting, which I also happen to cover on my blog. It would be great to get some feedback from those who share the same interest about Accountancy, here is my website Articleworld Thank you!

    15. I know a lot of folks whom I think would really enjoy your content that covers in depth. I just hope you wouldn’t mind if I share your blog to our community. Thanks, and feel free to surf my website Article Sphere for content about Blogging.

    16. Your style is really unique compared to other folks I’ve read stuff from. I appreciate you for posting when you’ve got the opportunity, Guess I’ll just book mark this page.

    17. Spot on with this write-up, I actually believe this website needs far more attention. I’ll probably be returning to read through more, thanks for the info.

    18. I’m impressed, I have to admit. Rarely do I encounter a blog that’s equally educative and engaging, and without a doubt, you have hit the nail on the head. The problem is something too few folks are speaking intelligently about. Now i’m very happy that I found this in my search for something regarding this.

    19. Greetings! Very helpful advice in this particular post! It is the little changes that will make the largest changes. Many thanks for sharing!

    20. I would like to thank you for the efforts you’ve put in writing this blog. I really hope to check out the same high-grade content by you in the future as well. In fact, your creative writing abilities has motivated me to get my own blog now 😉

    21. Your style is unique in comparison to other people I’ve read stuff from. I appreciate you for posting when you have the opportunity, Guess I’ll just bookmark this web site.

    22. Hi, I do think your blog could possibly be having browser compatibility issues. Whenever I take a look at your web site in Safari, it looks fine however when opening in I.E., it has some overlapping issues. I simply wanted to give you a quick heads up! Other than that, wonderful website!

    23. You’ve made some good points there. I checked on the web for additional information about the issue and found most individuals will go along with your views on this website.

    24. Hi! I could have sworn I’ve visited this website before but after browsing through a few of the articles I realized it’s new to me. Anyways, I’m definitely delighted I discovered it and I’ll be bookmarking it and checking back regularly.

    25. Hi, I believe your web site could be having internet browser compatibility issues. Whenever I look at your website in Safari, it looks fine however when opening in I.E., it has some overlapping issues. I merely wanted to give you a quick heads up! Aside from that, fantastic site!

    26. Howdy! I could have sworn I’ve been to your blog before but after looking at a few of the articles I realized it’s new to me. Regardless, I’m definitely pleased I came across it and I’ll be book-marking it and checking back regularly!

    27. Oh my goodness! Impressive article dude! Thank you so much, However I am encountering problems with your RSS. I don’t know why I cannot subscribe to it. Is there anybody else having the same RSS issues? Anybody who knows the solution will you kindly respond? Thanks!

    28. After going over a few of the blog articles on your web site, I honestly appreciate your technique of writing a blog. I added it to my bookmark webpage list and will be checking back in the near future. Please check out my website too and let me know your opinion.

    29. A motivating discussion is worth comment. I do believe that you need to publish more about this issue, it might not be a taboo matter but generally people do not discuss these subjects. To the next! Best wishes!

    30. The 30-day negotiating interval ended on January 14, 2010,
      with no announcement about the pending sale. Principal images commenced on Might 18, 2010, with capturing locations
      together with Chicago, Florida, and Moscow. The first
      six weeks were spent in Los Angeles: places included Sherman Oaks, Fourth Avenue, and 5.
      Most important. LaBeouf additionally stated that the
      additions of Huntington-Whiteley and new characters allows Darkish of the Moon to keep the “magic” of the first movie.

    31. I blog frequently and I seriously thank you for your information. Your article has really peaked my interest. I am going to book mark your blog and keep checking for new information about once per week. I subscribed to your Feed too.

    32. I’m very happy to uncover this web site. I wanted to thank you for ones time just for this fantastic read!! I definitely appreciated every little bit of it and i also have you saved as a favorite to see new information in your web site.

    33. After looking into a few of the blog articles on your web page, I seriously like your technique of blogging. I added it to my bookmark webpage list and will be checking back soon. Take a look at my web site as well and tell me how you feel.

    Leave a Comment

    Your email address will not be published. Required fields are marked *