Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
SQL Articles - Page 4 of 12
650 Views
It is used to return the name of the current user in sql database server. it does not accept any parameter. Syntax CURRENT_USER Current_user is the function used to get the name of current user Example 1 In this example, we are going to use the current_user function to get the current user name. Input Employee Emp_id Name Dept_name Salary 1 Monu IT 50000 2 Sonu HR 60000 3 Golu Security 70000 This database is currently used by amrendra. Code SELECT CURRENT_USER;#selected current user name Output Amrendra ... Read More
174 Views
A materialised is defined as a database object that contains the results of a particular query. It could be called as a subset of a table. Any changes in the base table would be reflected in the materialised view. Syntax CREATE MATERIALISED VIEW view_name AS SELECT * FROM table_name WHERE column_name IS NOT NULL PRIMARY KEY (provide_primary_key) Here, view_name is the name of the materialised view, table_name is the base table, column_name are the columns provide_primary_key are the primary keys for the base table. Example 1 In this example, we are gonna have a ... Read More
249 Views
Create a schema Schema is basically the logical representation of the database. there is a default schema named dbo. Objects gets created inside a schema when ‘create schema’ statement is used. To provide access to other user after the schema is created, we need to impersoinate permissions. Syntax:The syntax to create a schema is − Create schema schema_name Here, we have created a schema named schema_name. Example 1: Granting permissions In this example, we are going to create a schema and grant permissions to have access to that. Algorithm Step 1 − Create a schema. Step 2 − ... Read More
433 Views
A login is a security check process to authenticate the user and make their data secure. In case of SQL, we need to login to connect to the server. Creating login for the server gives a security advantage. Also, security implications are to be understood and kept in mind while creating a login. A user will be granted the access of the database after user login is provided. Here, we are going to use various methods. Method 1: login with Password We are going to use simply the userid and password to login to the server. Syntax Create login ... Read More
3K+ Views
SQLAlchemy is a SQL toolkit and Object-Relational Mapping (ORM) system for the Python programming language. It offers a full suite of well-known enterprise-level persistence patterns, intended for data manipulation in SQL. One feature developers often seek to utilize is accessing the value from a SQLAlchemy instance using a column name. This powerful technique can streamline database operations and improve code readability. This article guides you through the process of using this feature in your Python program, showcasing two practical approaches. Syntax Before we delve into the procedures, let's establish the syntax of the method we will use in our following ... Read More
4K+ Views
Python is a powerful and versatile programming language that is widely used for data analysis, machine learning, and other scientific applications. One of the reasons for its popularity is the availability of several powerful libraries and frameworks that make data manipulation and analysis a breeze. Among these, Pandas is a popular library for working with tabular data in Python. In this tutorial, we will explore how to convert SQL query results to Pandas Dataframe using pypyodbc. If you're working with data in Python, you're likely to encounter situations where you need to extract data from a SQL database and manipulate ... Read More
16K+ Views
Embedded SQL Embedded SQL is a method that combines SQL with a high−level programming language's features. It enables programmers to put SQL statements right into the source code files used to set up an application. Database operations may be carried out effortlessly by developers by adding SQL statements to the application code. The source code files having embedded SQL statements should be preprocessed before compilation because of the issue of interpretation of SQL statements by the high−level programming languages in embedded SQL. The terms EXEC SQL and END_EXEC must be used before and after each SQL statement in the source ... Read More
2K+ Views
It refers to a language that is used to insert, delete and update data in a database. It is used for the manipulation of data in the database.DCL is used together with DML because the changes made by dml wouldn't be saved permanently and have a chance of rolling back. Here are three DML commands: Insert into command It is used to insert a data row in a table. Syntax INSERT INTO table_name(col1, col2, col3, ..) VALUES (value1, value2, value3, ...); or INSERT INTO table_name VALUES (value1, value2, value3, ...); Example This example will show the ... Read More
2K+ Views
A schema is a logical structure that stores database objects in SQL Server. It offers a method for classifying and organizing database items including tables, views, and processes. There could be instances where you need to delete a schema from your database. The SQL Server DROP SCHEMA command is useful in this situation. We can delete a schema from the database using the DROP SCHEMA statement. For database administrators and developers who wish to effectively control the structure of their databases, the Drop statement is a crucial tool. Syntax DROP SCHEMA [ IF EXISTS ] schema_name; Here, If ... Read More
35K+ Views
Embedded SQL is a powerful method that allows the integration of high−level programming languages with database management systems (DBMS). It acts as a bridge between applications and databases which helps in data manipulation and communication. Various database management systems offer embedded SQL, giving developers the freedom to select the one that best serves their requirements. Popular DBMS that support Embedded SQL are Altibase, IBM Db2, Microsoft SQL Server, Mimer SQL, Oracle Database, PostgreSQL, and SAP Sybase. Need of Embedded SQL The goal to make database interactions simpler for application developers and end users determines the demand for embedded SQL. ... Read More