Trending February 2024 # Learn The Examples Of Sql Extensions # Suggested March 2024 # Top 9 Popular

You are reading the article Learn The Examples Of Sql Extensions updated in February 2024 on the website We hope that the information we have shared is helpful to you. If you find the content interesting and meaningful, please share it with your friends and continue to follow and support us for the latest updates. Suggested March 2024 Learn The Examples Of Sql Extensions

Introduction to SQL extensions

A sql extensions is a file extension used for files containing standard query language(SQL) queries and commands to create and modify relational database objects. It is identified as .sql type. The SQL file format is written in ASCII. For the uninitiated, it can be considered a flat-file with nothing but a set of SQL statements. For example, statements for creating, inserting, extracting, updating, or deleting a data table in SQL databases. It does not contain the entire database in it.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

You must be wondering when and how we are going to use the SQL extension. The most frequent use of the .sql extension is when we have to run certain queries multiple numbers of times. Imagine writing the same query those many times. It’s terrifying right. We can instead save the query with .sql extension and open, re-run or edit it n number of times without having to rewrite the entire query again and again. Another important usage of sql extension is backing and restoring database backups. Some database servers such as SQL Server and MYSQL support this. One more prominent usage of .sql extension is exporting and sharing user-defined schemas, functions, procedures, and triggers with other users.

Examples of SQL extensions

Next, let us cover some fundamentals such as creating and opening a file with sql extension.

Example #1 – Creating a sql file extension


Having created the database, let us create a table called “cities” in it that contains a list of cities with their ids and country. Here is the create table statement for the city table.

CREATE TABLE cities ( id int NULL, country varchar (50) NULL, city varchar (50) NULL );

Now we are all set to script this create table statement using extension so that we can reuse the code. Follow the following steps for more.

Step 1: Go to object explorer

Step 2: Select the desired database

Step 3: Select the table which you want to script

Here is an image to illustrate the flow.

Once you are done with navigation, move to step 4.

Step 4: SELECT the desired statement that has to be scripted.

Step 5: Choose a file from the next menu and save the script with the desired name. Here, the file of the extension type by default. If that’s not the case for you, mention .sql as a file extension.

Example #2 – Opening a sql file extension

Opening a file of the sql extension type is as easy as creating one. You just follow the following steps.

Step 1: Go to File Menu

A dialog box as shown below will appear in front of you.

The file of the sql extension type will have the following statements. It is basically the CREATE To script for the cities table. Just run this script to create the table.

USE [Test_db] GO /****** Object:  Table [dbo].[cities]    Script Date: 07/10/2024 12:04:49 ******/ SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO SET ANSI_PADDING ON GO CREATE TABLE [dbo].[cities]( [id] [int] NULL, [country] [varchar](50) NULL, [city] [varchar](50) NULL ) ON [PRIMARY] GO SET ANSI_PADDING OFF GO

We have successfully created the table from a script (a file of sql extension type).

Example #3 – Working with .sql files

Suppose we do not have access to the Server query editor, but we want to write a query to insert a few records into the cities table. We can use text editors such as notepad, notepad++, atom, sublime, vim, etc. to view, write, or edit .sql files.

INSERT INTO [Test_db].[dbo].[cities] ([id] ,[country] ,[city]) VALUES (1,'India', 'New Delhi'), (2,'U K','London') GO

Having successfully written and saved the query in the text editor, the next task is to open the file. So open the .sql file in the server as discussed above. The query will be automatically opened in the query editor as shown below.

Now execute the query to insert records in the city table. Let us check using a SELECT statement if the data has been successfully entered.

SELECT * FROM cities;

Yes, it has been successfully populated. If you wish to re-run the same SELECT query or share it with your teammates, just save it (by pressing Ctrl + S or from the file menu). Again a dialog box as shown below will appear.

Just save it and you are good to go.


SQL extension is a file format that is used to store and save sql commands, queries, functions, triggers, etc. so that they can be reused and shared.

Recommended Articles

We hope that this EDUCBA information on “SQL extensions” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

You're reading Learn The Examples Of Sql Extensions

Learn The Different Examples Of Python Widgets

Introduction to Python Widgets

Widgets are small parts on web applications that allow user input. The widgets are eventful objects of Python that have a browser representation, often as control such as a slider, textbox, etc. Interactive GUIs for Python notebook are created using these Widgets. Synchronize stateless and stateful information between JavaScript Python and is done using widgets. Widget input allows us to add parameters and dashboards to the notebooks. Widget API has calls that can be given with various types of input, access bound values, and removing them. Exploration of different parameters using a single query are the results of widgets. Widgets are of many types. Few are Text, drop down, Combo box, Multi-select, which are widely used. All these widgets are quiet neat to understand and implement.

Start Your Free Software Development Course

Web development, programming languages, Software testing & others

Syntax of Widgets

import widget_name


Ipywidgets packages furnish a lot of common interface controls. These interfaces are used in exploring code and data interactively. These can be customised and assembled for creating user interfaces that are complex. Let’s see various schemes to create user interfaces using Python Ipywidgets. The package of widgets in Python can be installed in Anaconda by default. Manual installation is done with conda install Ipywidgets. Or you can also use pip install Ipywidgets, but then an extension for Jupyter Notebook is needed.

Now, getting into the actual methodology:

The block of code shows how we import the widgets. These are few widgets which are used in general.


import Ipywidgets as widgets from Ipywidgets import Hbox, Vbox import numpy as np import matplotlib.pyplot as plt from Ipython.display import display %matplotlib inline Examples of Python Widgets

Widgets have an @interact decorator, which controls the function of arguments. The f() function receives an integer as an argument. That displays a slider by default.

Example #1

Displaying a slider which has border values and can be slid along, which is an integer slider.


import Ipywidgets as wg import Ipython.display name = chúng tôi (value = ‘Name’) age = wg.IntSlider (description = ‘Age: ’) display (name, age) print (name.value + ‘ is already ‘+ str (age.value) + ‘ now ’)


The above displays an age bar or a slider, where you can slide the age of John and hold at one. It is still changeable. At age.value, you need to consider taking the value as a string as it is a number or integer, and it needs to be typecasted because all the other parameters in the command line are integers.

You can also import the FloatText widget, which is the same as above but includes a floating-point slider. Wg.FloatText() is used.

Example #2


import numpy as np %matplotlib inline From matplotlib.pyplot as plt def myPlot (c): x = np.linspace(-5,5,20) y = c * x**2  # we are going to have a parabola here. plt.plot (x, y, ‘ r-- ‘) # let us make a plot using x and y values plt.ylabel (‘ y (x) ’) # create y label and make It y (x) plt.xlabel (‘ x ‘) # x label and named it x plt.ylim([ 0, 80 ]) plt.xlim ([ -5, 5 ])

myPlot(10) #running the plot with a random value.


But our point is to see the plot change with respect to c.

For that, we include a cSlider which sides along with the possible given values and updates the plot automatically. We can give a FloatSlider as well.


c_slide = wg.FloatSlider ( value = 1.0, min = 0.5, max = 3.5, steps = 0.2 ) #Then run the function by calling myPlot and include parameters to use. wg.interact (myPlot, c = c_slide)


c_slide.key: This is the keywords which display all the different types of widgets you might want to change. This will display quiet a big list.

wg.Widgets.widget_types: This is the keyword used to displays all the types of Widgets that can be used.

Example #3


import time progress = wg.IntProgress ( description = ‘ Loading: ’ ) progress.orientation = ‘horizontal’ #we can use vertical as well. display(progress) for i in range (100) progress.value = i time.sleep (0.1)


The loading bar in the above block of code can be taken as vertical, which shows a vertical orientation.

Try typing “import this” on Python IDE; you’ll find a poem highlighting the philosophies of Python.



Demonstration of many features of packages is done by importing Ipywidgets. Widgets can be styled and customised. They can be created using JavaScript and Python Notebook – Jupyter in this case. If you remove the keyword widget in case the same cell cannot be accessed, create subsequent command. Nevertheless, a widget can be created in another cell.

Recommended Articles

This is a guide to Python Widgets. Here we discuss the introduction to Python Widgets along with the examples, respectively. You may also have a look at the following articles to learn more –

Usage And Different Examples Of Sql Max()

Introduction to SQL MAX()

SQL MAX() is one of the aggregate functions available in SQL that helps us fetch the greatest value among multiple values specified in the column values of records, the expression consisting of the column that is mentioned. When a query is used to retrieve the data that report related and contains a group by a statement, the MAX() function is used to get the greatest value of a particular column or columns based on the grouping function.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Syntax and Usage

The syntax of the MAX function in SQL is given below:

SELECT MAX(expression) FROM table_name [WHERE restriction];

Where expression can be any name of the column of the table or a formula built up using column names and static literal values or variables, the table_name is the name of the table from which you want to retrieve the records and calculate the greatest value from one of their columns. The use of the FROM table name clause is required. One optional thing is the use of a where clause to mention the conditions and restrictions that the records of the table should fulfil to consider that record’s column value for fetching the greatest value.

Examples of SQL MAX()

Given below are the examples of SQL MAX():

Example #1 – Using a single column.

Let us firstly consider a simple example that we used above. We will calculate the greatest value of SQL numbers using the MAX() function. Let us create one simple table named numbers and store the num column value in it.

We will use the following query statement to create our table.


CREATE TABLE numbers (num INT) ;

Now, we will insert the above records in the table.


INSERT INTO numbers(num) VALUES (50), (100), (150), (200);

Let us now retrieve the records once.


SELECT * FROM numbers ;


Now, we will calculate the greatest of num column of numbers table using MAX() function using the following query statement.


SELECT MAX(num) FROM numbers ;


Example #2 – Using the distinct function.

We can use the distinct function in MAX() function to consider the column’s repetitive values only once while fetching the greatest value. Suppose that we insert some more records in the numbers table using the following query statement.


INSERT INTO numbers(num) VALUES (350), (800), (150), (300),(450), (100), (250); select * from numbers;

If we use SELECT MAX(num) FROM numbers; statement to calculate the greatest value of num column, then each of the values will be considered while fetching the greatest value.



The output will be the same as that of the first query without a distinct function but internally the calculation of greatest value by MAX() function will only consider the column values that are repeated such as 100 and 150 only once.

The output of both of the above queries is as shown below.


Example #3 – Using formula.

We can use the MAX() function expressions to consider the value evaluated by fetching each of the formula or expression values containing column value to calculate the greatest value.

Let us consider one example; we will calculate the greatest of all the columns after they are multiplied by 10 and added by 1.


SELECT MAX((num * 10) + 1) FROM numbers ;


We can even use the existing functions such as SUM() and COUNT() inside the MAX() function.

Example #4 – Using group by.

When we have complex tables and relations between multiple tables, we have to query those tables using joins to retrieve data, usually for reporting purposes that consist of summarized data. Even in some scenarios, the data from a single table need to be manipulated to get summarized data. Suppose that we have one table named workers consisting of the following records in it that are retrieved by executing a simple select query on that table.


SELECT * FROM workers;


Now, the situation is such that we have to calculate the greatest salary of the workers per team. The output should consist of the team id and the greatest salary of that team. For this, we will have to use the group by statement and group the records based on team id and calculate the greatest salary by using MAX() function.


SELECT team_id, MAX(salary) FROM workers GROUP BY team_id ;

The execution of the above query statement will give the following output along with team ids and their respective greatest salaries.



We can use the MAX() function in SQL to fetch the greatest value of the columns of the tables or greatest of expressions that involve column values and even calculate the greatest value of columns in the grouped manner using the GROUP BY statement.

Recommended Articles

We hope that this EDUCBA information on “SQL MAX()” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

Learn The Basic Concept Of Fopen Statement (Examples)

Introduction to Matlab fopen

Matlab fopen statement is used for an open a file or obtains information about open files. The file handling operations like reading from file or writing on a file for these operations we need to first open a file for that fopen statement is used. We open a file in binary mode or text mode and we specify the access type like r, w, r+, a, etc. and the default access type is read. The fopen statement returns data stored in fileID1, fileID1 is a file identifier on open file.


Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

fileID1 = fopen(filename)

fileID1 = fopen(filename,permission)

fileID1 = fopen(filename,permission,machinefmt,encodingIn)

fIDs = fopen('all')

filename = fopen(fileID)

[filename,permission,machinefmt,encodingOut] = fopen(fileID)

How to Use Matlab fopen?

We use fopen statement for only open the file for these we don’t need to specify anything simply we take a fopen statement and that file name which we want to open. But in another case, if we want to write or read from file we must specify the access type in fopen statement. For these we want to specify the permission, the permission is as followed:

‘r’: The file is open for reading. And it’s a default condition.

‘r+’: The file is open for both reading as well as writing.

‘w’: It will delete the contents of an existing file or simply it creates a new file and opens it for writing.

‘w+’: It will delete the contents of an existing file or simply it creates a new file, and open it for both readings as well as writing.

‘a’: It will create and open a new file or open an existing file for writing, appending to the end of the file.

‘a+’: It will create and open a new file or open an existing file for reading and writing, appending to the end of the file.

‘A’: It will append without automatic flushing; used with tape drives

Examples to Implement Matlab fopen

Below are the examples of Matlab fopen:

Example #1

Let us see one example, in this example, we open the text file using fopen and read the data from that file. For these first we take a fopen statement, in this fopen we specify that which file we want to open that file name and the access type mode of that file, for those we take fopen in parenthesis text file name with .txt extension chúng tôi and the access type mode is read ‘r’ and these two arguments are separated by a comma. And this fopen statement we take in a file identifier that is fileID1. And then we simply read that file using a fscanf statement. And lastly, we need to close that file using a file identifier and close statement; the file close statement is fclose and files identifier of open file that is fileID1.

fileID1 = fopen(‘textfile1.txt’,’r’);formatSpec = ‘%s’;A1 = fscanf(fileID1,formatSpec)fclose(fileID1);


Example #2

Let us see an example related to the fopen statement, we already created one text file with extension .txt ‘file1.txt’ in that text file we write something information. For reading or displaying one line from that text file, we write a Matlab code, in Matlab code, we use a fopen statement fopen statement is used for an open a file or obtain information about an open file. In this example, we used fopen statement for an open a text file which we earlier created with the name ‘file1’. Then we assign a file identifier to that fopen statement. Then we use an ‘fgetl’ function it is an inbuilt function available on Matlab it used for reading one line from a file. This readied line stored in line variable and we displaying that data and then we close the file, for closing a file we take fclose in that file identifier.


tline = fgetl(fileID)fclose(fileID);

Example #3

Let us see one example related to fopen statement, in this example, we create a matrix using a magic function, the magic function is nothing but it creates a matrix of n-n number in our example it creates 4- by-4 matrix. The matrix is stored in variable A1. This matrix we want to write in a file for that we need to open that file. To open a file we use a fopen statement, fopen in parenthesis the file name in which we want to write a matrix and a type of access mode that is written ‘w’ and these we assign to the fileID1, fileID1 is a file identifier of an open file. Then we use a fprintf statement to write that matrix on a text file. Then we simply close that open file by using a file close statement and a file identifier of an open file. And for verification that the matrix is written on that text file or not we use a type function, type in parenthesis that file name in which we write a matrix.


A1 = magic(4);fileID1 = fopen (‘myfile1.txt’,’w’);nbytes1 = fprintf(fileID1,’%6d %6d %6d %6dn’,A1)fclose(fileID1);type(‘myfile1.txt’)



In this article we saw the basic concept of fopen statement, basically fopen is nothing but an open a file or obtain information about open files. We also saw the different syntax for fopen statement used in Matlab code. Also, we saw the different some examples related to fopen.

Recommended Articles

This is a guide to Matlab fopen. Here we discuss the Introduction to Matlab fopen and its Syntax along with different Examples and its Code Implementation. You can also go through our suggested articles to learn more –

Learn The Example Of Angularjs Ng

Introduction to AngularJs ng-repeat

Web development, programming languages, Software testing & others

How Angular CLI works?

In the AngularJS framework, it is very important to know that all the In-Built directives that the AngularJS framework has provisioned will always be denoted with ng. As soon as you declare the ng-repeat directive attribute in the HTML page of your AngularJS application, the Framework knows what has to be done as it’s inbuilt the definition is defined with AngularJS framework itself. Each time ng-repeat is invoked, it initializes a template for each object from the list/collection, and each template element has its own scope.

Each object can be referred to using the local variable defined in the ng-repeat tag. The ng-repeat should be used as an attribute inside any HTML tag such as div, paragraph, table, button, href, etc. To know the index of each object in the list and keep track of it, the track by $index property can be used. Tracking by some other id parameter (not $index) which is present inside the object can also be done using track by chúng tôi Along with $index, there are few more such properties defined by AngularJS which can be used with ng-repeat, such as

$first – Will return true if the object is the first object in the List

$last – Will return true if the object is the Last object in the List

$middle – Will return true if the object is in between the List

$odd – If the value of $index is an odd number, it will return true

$even – If the value of $index is an even number, it will return true

ng-init can also be used along with the ng-repeat directive, which can help you to add an additional parameter for each object in the list ONLY for that scope of the template instance.

While using ng-repeat, something to keep a note of is that any object starting with the $ symbol will not be read by the ng-repeat directive and get ignored as its AngularJS and $ is a prefix used by AngularJS for public or private properties.



.grocery-list-class { margin-top: 20px; cursor: pointer; } .name { font-weight: bold; } .amt, .qunatity, .desc { font-weight: normal; } .amt { text-align:right; vertical-align: centre; color:blue; } h1 { text-align:center; color: orange; }

angular.module('myGroceryApp', []) .controller('GroceriesController', function($scope) { $scope.groceriesList = []; var grocery1 = {"name": "Olive Oil", "description": "The description of this oil", "amount": 154.50}; var grocery2 = {"name": "Whole Wheat Bread", "description": "The description of this Bread", "amount": 35}; var grocery3 = {"name": "Tomato Suace", "description": "The description of this Sauce", "amount": 50}; var grocery4 = {"name": "Brown Rice", "description": "The description of this Rice", "amount": 200}; var grocery5 = {"name": "Rose Water", "description": "The description of this Product", "amount": 55.75}; $scope.groceriesList.push(grocery1, grocery2, grocery3, grocery4, grocery5); });

In the above example, we are trying to display a list of groceries that have been added to the cart in tabular format on UI using the ng-repeat directive.

Make sure to include the AngularJS dependency in the Script tag so that you will be able to use the ng-repeat directive of AngularJS.

ng-repeat="grocery in groceriesList track by $index"

Here grocery is each object inside the groceries list, which is a list of all groceries in the cart. We have used a track by $index to keep track of each grocery inside the groceries list

ng-init="quantity = 1"

ng-init can be used to add any new parameter inside each grocery, and here we have added quantity to default to 1 for each grocery in the grocery list

Also, if we need to use the filter for filtering elements based on the amount or any other parameter, the filter can be used along with the ng-repeat directive and easily filter out the elements.

Just by using a few simple and easy CSS styling, we will be able to arrange the cart properly and view the contents on UI just like we want to below the output of the above code.


The ng-repeat directive in AngularJS is a very useful and one of the most widely used In-Built AngularJS directives, which are used to iterate through a list of elements and display the objects on the UI along with CSS styling, tracking by index and comes with a very little piece of code and easy to use and understand. Knowing the syntax is all that is needed, and you are ready to go. Filters can also be used with this ng-repeat directive to make it more efficient.

Recommended Articles

We hope that this EDUCBA information on “AngularJs ng-repeat” was beneficial to you. You can view EDUCBA’s recommended articles for more information.

6 Of The Best Libreoffice Extensions You Should Use

LibreOffice is already packed with features, and I bet there are dozens of them you rarely or never use. However, it’s possible some of the features you need don’t come with LibreOffice by default but in the form of an extension. Here is a list of some of the best LibreOffice addons that will provide the greatest value for you.

1. Alternative Dialog Find & Replace for Writer (AltSearch)

The default “Find & Replace” functionality in LibreOffice Writer does more than basic find and replace, and I guess for many users this is more than what they need. However, if you, like me, have more complex find and replace tasks to perform, you may want to check the AltSearch extension.

2. MultiSave

If you work with documents in multiple formats – e.g. you write the document in .ODT because this is the format of your choice but need to submit the final version in Microsoft Word format and/or export it in PDF, then you will certainly love the MultiSave extension.

Enter the name of the file and the location you want to save it to. Then choose which formats to save it simultaneously to. This addon is very handy when you need to have the same file in two or all of these formats. For instance, the invoices for a client of mine are in PDF. I write the original in .html, and it’s not unlikely to submit the wrong PDF version simply because I made the changes in the html file and forgot to export them to the PDF one. With this extension the changes are written immediately to the PDF, too.

3. Calendar for Calc

4. Code Colorizer Formatter

5. ShowNotes

ShowNotes is an addon that was released more than five years ago, but it still works. It’s a simple extension for Calc that allows you to show/hide all the notes for all cells. This is so much easier than to have to check all the cells with notes one by one.

6. A Spell Checker, Grammar Checker or a Dictionary Extension for Your Language

If you are using languages other than English, check the dictionary extensions to see if there are dictionaries, grammar checkers, spell checkers and other language tools for the language(s) of interest to you. There are language tools for Spanish, French, Russian, German, Danish, Turkish, etc., so just pick the one(s) you need.

There are quite a number of extensions for LibreOffice and not every one is useful. Those that I have included are the more useful ones and compatible with the latest LibreOffice versions.

If you expected thousands of LibreOffice addons to choose from, you will be disappointed – there are probably just a few dozen of recently-updated addons. If you are curious to see what else is available, check this list of LibreOffice Extensions. Just be warned that not all of them are recent, and they might not work for your LibreOffice version.

Ada Ivanova

I am a fulltime freelancer who loves technology. Linux and Web technologies are my main interests and two of the topics I most frequently write about.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Sign up for all newsletters.

By signing up, you agree to our Privacy Policy and European users agree to the data transfer policy. We will not share your data and you can unsubscribe at any time.

Update the detailed information about Learn The Examples Of Sql Extensions on the website. We hope the article's content will meet your needs, and we will regularly update the information to provide you with the fastest and most accurate information. Have a great day!