Skip to content
pvmehta.com

pvmehta.com

  • Home
  • About Me
  • Toggle search form
  • login.sql Oracle
  • How to find who is using which Rollback segment and how many rows or blocks in that rollback segments, Oracle
  • USE_NL and INDEX hints example Oracle
  • rm_backup_arch_file.ksh Linux/Unix
  • Explain Plan Doesn’T Change For Sql After New Statistics Generated Oracle
  • export import with parameter file. Oracle
  • Another export with Query Oracle
  • oracle Dba site Oracle
  • Adding Datafile on Primary Server and Impact on Standby Server Oracle
  • Kernel Parameters for Solaris Linux/Unix
  • Oracle vs MYSQL Architecture differences (For DBAs) MYSQL
  • Consolidated Reference List Of Notes For Migration / Upgrade Service Requests -ID 762540.1 Oracle
  • Another Tuning Article for subheap of shared pool Oracle
  • Find_table_size.sql Oracle
  • VIvek Encryption Package and Its Usage Oracle

Getting started with notebook

Posted on 30-Sep-202330-Sep-2023 By Admin No Comments on Getting started with notebook
# Databricks notebook source

 

%sql
create database if not exists abcdb

 

%sql
use abcdb

 

%sql
create table student (id int , name string)

 

%sql
insert into student
select 1 as id, ‘user1’ as name

 

%sql
select * from student

 

spark.sql(“create database if not exists xyzdb”)
spark.sql(“use xyzdb”)

 

# Use three double quotes (“””) if SQL you are using has multiple lines.
spark.sql(“”” create table student1
        ( id int,
        name string )”””)

 

spark.sql(“”” insert into student1
        select 2 as id, ‘test1’ as name””” )

 

# Different format of printing or displaying dataframe.

# Selecting rows from dataframe
spark.sql(“select * from student1”).display()
spark.sql(“select * from student1”).show()

# Storing result-set in collection
spark.sql(“select * from student1”).collect

# Describe schema and datatype
spark.sql(“select * from student1”).printSchema()

 
Python/PySpark

Post navigation

Previous Post: Read CSV file using PySpark
Next Post: Add new columns in dataframe

Related Posts

  • Reading config file from other folder inside class Python/PySpark
  • Read CSV File using Python Python/PySpark
  • Python class import from different folders Python/PySpark
  • How to connect to Oracle Database with Wallet with Python. Oracle
  • Read CSV file using PySpark Python/PySpark
  • Add new columns in dataframe Python/PySpark

Leave a Reply Cancel reply

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

Categories

  • Ansible (0)
  • AWS (2)
  • Azure (1)
  • Django (0)
  • GIT (1)
  • Linux/Unix (149)
  • MYSQL (5)
  • Oracle (393)
  • PHP/MYSQL/Wordpress (10)
  • POSTGRESQL (1)
  • Power-BI (0)
  • Python/PySpark (7)
  • RAC (17)
  • rman-dataguard (26)
  • shell (149)
  • SQL scripts (342)
  • SQL Server (6)
  • Uncategorized (0)
  • Videos (0)

Recent Posts

  • Complete Git Tutorial for Beginners25-Dec-2025
  • Postgres DB user and OS user.25-Dec-2025
  • Trace a SQL session from another session using ORADEBUG30-Sep-2025
  • SQL Server Vs Oracle Architecture difference25-Jul-2025
  • SQL Server: How to see historical transactions25-Jul-2025
  • SQL Server: How to see current transactions or requests25-Jul-2025
  • T-SQL Vs PL/SQL Syntax25-Jul-2025
  • Check SQL Server edition25-Jul-2025
  • Checking SQL Server Version25-Jul-2025
  • Oracle vs MYSQL Architecture differences (For DBAs)24-Jul-2025

Archives

  • 2025
  • 2024
  • 2023
  • 2010
  • 2009
  • 2008
  • 2007
  • 2006
  • 2005
  • Processes Parameter decision Oracle
  • Query to Generate aggregate on every 30 mins. Oracle
  • Does DBMS_JOB recompute the NEXT_DATE interval after or before Oracle
  • Sample WW22 listener.ora Oracle
  • eplan.sql Oracle
  • Vivek Tuning for Row Locks. Oracle
  • Drop database in Oracle 10g Oracle
  • create a folder in multiple places Linux/Unix

Copyright © 2026 pvmehta.com.

Powered by PressBook News WordPress theme